|
17 | 17 | #include "PWGJE/DataModel/JetSubtraction.h" |
18 | 18 | // |
19 | 19 | #include "PWGLF/DataModel/LFParticleIdentification.h" |
| 20 | +#include "PWGLF/DataModel/mcCentrality.h" |
20 | 21 | #include "PWGLF/Utils/inelGt.h" |
21 | 22 |
|
22 | 23 | #include "Common/Core/RecoDecay.h" |
@@ -190,6 +191,7 @@ struct nucleiInJets { |
190 | 191 | // using EventTable = soa::Join<aod::JetCollisions, aod::EvSels, aod::CentFT0Ms, aod::CentFV0As, aod::CentFT0Cs>; |
191 | 192 | using EventTable = aod::JetCollisions; |
192 | 193 | using EventTableMC = soa::Join<EventTable, aod::JMcCollisionLbs>; |
| 194 | + using JetMcCollisionWithCent = soa::Join<aod::JetMcCollisions, aod::McCentFT0Cs, aod::McCentFV0As>::iterator; |
193 | 195 | using JetCollWithLabel = o2::soa::Join<aod::JetCollisions, aod::JMcCollisionLbs, aod::BkgChargedRhos>::iterator; |
194 | 196 | using TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullKa, |
195 | 197 | aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTPCFullTr, aod::pidTOFFullPi, aod::pidTOFFullKa, |
@@ -600,13 +602,16 @@ struct nucleiInJets { |
600 | 602 | // Event and signal loss analysis histograms (inclusive) |
601 | 603 | jetHist.add("eventLoss/hEventStatistics", "Event Statistics for Loss Analysis", kTH1F, {{10, 0.f, 10.f}}); |
602 | 604 | jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(1, "All Generated"); |
603 | | - jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(2, "Gen |Vz|<10"); |
| 605 | + jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(2, "Gen |Vz| cut"); |
604 | 606 | jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(3, "Gen True INEL>0"); |
605 | 607 | jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(4, "Has Reco Coll"); |
606 | 608 | jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(5, "Pass Sel8"); |
607 | | - jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(6, "Pass |Vz|<10"); |
608 | | - jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(7, "Pass rec INEL>0"); |
609 | | - jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(8, "EvSelPassedRecINELgt0"); |
| 609 | + jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(6, "Pass reco |Vz| cut"); |
| 610 | + jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(7, "Pass extra event sel"); |
| 611 | + jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(8, "Reco selected"); |
| 612 | + jetHist.get<TH1>(HIST("eventLoss/hEventStatistics"))->GetXaxis()->SetBinLabel(9, "Reco selected + true INEL>0"); |
| 613 | + jetHist.add<TH2>("eventLoss/hRecoCollPerMCCollVsCent", "Reco collisions per MC collision;N_{reco coll};Centrality", HistType::kTH2F, {{10, -0.5f, 9.5f}, {100, 0.f, 100.f}}); |
| 614 | + jetHist.add<TH2>("eventLoss/hSelectedRecoCollPerMCCollVsCent", "Selected reco collisions per MC collision;N_{selected reco coll};Centrality", HistType::kTH2F, {{10, -0.5f, 9.5f}, {100, 0.f, 100.f}}); |
610 | 615 |
|
611 | 616 | // Signal loss histograms (only the ones that are actually used) |
612 | 617 | jetHist.add<TH3>("eventLoss/signalLoss/h3GenParticlesPtVsEtaVsCent_INELgt0", "Generated Particles p_{T} vs #eta vs Centrality", HistType::kTH3F, {{PtAxis}, {100, -1.5f, 1.5f}, {100, 0, 100}}); |
@@ -733,6 +738,10 @@ struct nucleiInJets { |
733 | 738 | jetHist.add<TH2>("eff/recmatched/perpCone/pt/PtParticleTypeTPCTOFVeto", "Pt (p) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}}); |
734 | 739 | jetHist.add<TH3>("eff/recmatched/gen/pt/PtParticleType", "Pt (p) vs jetflag vs particletype", HistType::kTH3D, {{PtAxis}, {2, 0, 2}, {14, -7, 7}}); |
735 | 740 | jetHist.add<TH2>("eff/recmatched/gen/perpCone/pt/PtParticleType", "Pt (p) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}}); |
| 741 | + jetHist.add<TH3>("eff/recmatched/mcC/gen/pt/PtParticleType", "Pt (gen, mcC) vs jetflag vs particletype", HistType::kTH3D, {{PtAxis}, {2, 0, 2}, {14, -7, 7}}); |
| 742 | + jetHist.add<TH3>("eff/recmatched/mcCSpectra/gen/pt/PtParticleType", "Pt (gen, mcCSpectra) vs jetflag vs particletype", HistType::kTH3D, {{PtAxis}, {2, 0, 2}, {14, -7, 7}}); |
| 743 | + jetHist.add<TH2>("eff/recmatched/mcC/gen/perpCone/pt/PtParticleType", "Pt (gen, mcC, perp cone) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}}); |
| 744 | + jetHist.add<TH2>("eff/recmatched/mcCSpectra/gen/perpCone/pt/PtParticleType", "Pt (gen, mcCSpectra, perp cone) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}}); |
736 | 745 | // gen matched |
737 | 746 | jetHist.add<TH2>("genmatched/hRecMatchedJetPt", "matched jet pT (Rec level);#it{p}_{T,jet part} (GeV/#it{c}); #it{p}_{T,jet part} - #it{p}_{T,jet det}", HistType::kTH2F, {{100, 0., 100.}, {400, -20., 20.}}); |
738 | 747 | jetHist.add<TH2>("genmatched/hRecMatchedVsGenJetPt", "matched jet pT (Rec level);#it{p}_{T,jet det}; #it{p}_{T,jet part} (GeV/#it{c})", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}); |
@@ -2414,8 +2423,22 @@ struct nucleiInJets { |
2414 | 2423 |
|
2415 | 2424 | if (mapPDGToValue(mcParticle.pdgCode()) != 0) { |
2416 | 2425 | jetHist.fill(HIST("eff/recmatched/gen/pt/PtParticleType"), mcParticle.pt(), jetFlagMC, mapPDGToValue(mcParticle.pdgCode())); |
| 2426 | + if (useMcC) { |
| 2427 | + if (useDataLikeHist) { |
| 2428 | + jetHist.fill(HIST("eff/recmatched/mcC/gen/pt/PtParticleType"), mcParticle.pt(), jetFlagMC, mapPDGToValue(mcParticle.pdgCode())); |
| 2429 | + } else { |
| 2430 | + jetHist.fill(HIST("eff/recmatched/mcCSpectra/gen/pt/PtParticleType"), mcParticle.pt(), jetFlagMC, mapPDGToValue(mcParticle.pdgCode())); |
| 2431 | + } |
| 2432 | + } |
2417 | 2433 | if (jetFlagPerpConeMC) { |
2418 | 2434 | jetHist.fill(HIST("eff/recmatched/gen/perpCone/pt/PtParticleType"), mcParticle.pt(), mapPDGToValue(mcParticle.pdgCode())); |
| 2435 | + if (useMcC) { |
| 2436 | + if (useDataLikeHist) { |
| 2437 | + jetHist.fill(HIST("eff/recmatched/mcC/gen/perpCone/pt/PtParticleType"), mcParticle.pt(), mapPDGToValue(mcParticle.pdgCode())); |
| 2438 | + } else { |
| 2439 | + jetHist.fill(HIST("eff/recmatched/mcCSpectra/gen/perpCone/pt/PtParticleType"), mcParticle.pt(), mapPDGToValue(mcParticle.pdgCode())); |
| 2440 | + } |
| 2441 | + } |
2419 | 2442 | } |
2420 | 2443 | } |
2421 | 2444 | } // mcParticle |
@@ -2714,96 +2737,113 @@ struct nucleiInJets { |
2714 | 2737 | } |
2715 | 2738 |
|
2716 | 2739 | // Process function for event and signal loss analysis (inclusive) |
2717 | | - void processEventSignalLoss(aod::JetMcCollision const& mcCollision, |
| 2740 | + void processEventSignalLoss(JetMcCollisionWithCent const& mcCollision, |
2718 | 2741 | soa::SmallGroups<soa::Join<aod::JMcCollisionLbs, aod::JetCollisions>> const& recoColls, |
2719 | 2742 | aod::JetParticles const& mcParticles, |
2720 | 2743 | TrackCandidates const&) |
2721 | 2744 | { |
2722 | | - |
2723 | | - // Fill generated event statistics |
2724 | 2745 | jetHist.fill(HIST("eventLoss/hEventStatistics"), 0.5); // All Generated |
2725 | 2746 |
|
2726 | | - // Check if we have a reconstructed collision |
2727 | | - bool hasRecoColl = false; |
2728 | | - bool passSel8 = false; |
2729 | | - bool passVz = false; |
2730 | | - bool passINELgt0 = false; |
2731 | | - bool isSel8 = false; |
2732 | | - |
2733 | | - float centrality = -999; |
| 2747 | + auto mcParticles_perColl = mcParticles.sliceBy(perMCCol, mcCollision.globalIndex()); |
| 2748 | + float centrality = -999.f; |
2734 | 2749 | switch (centralityType) { |
2735 | | - case 0: // FT0M |
| 2750 | + case 0: |
2736 | 2751 | centrality = mcCollision.centFT0M(); |
2737 | 2752 | break; |
2738 | | - case 1: // FT0C |
2739 | | - centrality = mcCollision.multFT0C(); |
| 2753 | + case 1: |
| 2754 | + centrality = mcCollision.centFT0C(); |
2740 | 2755 | break; |
2741 | | - case 2: // V0A |
2742 | | - centrality = mcCollision.multFV0A(); |
| 2756 | + case 2: |
| 2757 | + centrality = mcCollision.centFV0A(); |
2743 | 2758 | break; |
2744 | 2759 | default: |
2745 | | - centrality = -999; |
| 2760 | + centrality = mcCollision.centFT0M(); |
| 2761 | + break; |
2746 | 2762 | } |
| 2763 | + const bool passGenVz = std::abs(mcCollision.posZ()) < cfgMaxZVertex; |
| 2764 | + const bool mcINELgt0 = o2::pwglf::isINELgt0mc(mcParticles_perColl, pdgDB); |
2747 | 2765 |
|
2748 | | - // Check INEL>0 at MC level using PWGLF functionality |
2749 | | - bool mcINELgt0 = o2::pwglf::isINELgt0mc(mcParticles, pdgDB); |
2750 | | - if (mcCollision.posZ() < 10) { |
2751 | | - jetHist.fill(HIST("eventLoss/hEventStatistics"), 1.5); |
2752 | | - if (mcINELgt0) { |
2753 | | - jetHist.fill(HIST("eventLoss/hEventStatistics"), 2.5); |
2754 | | - } |
| 2766 | + if (!passGenVz) { |
| 2767 | + return; |
| 2768 | + } |
| 2769 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 1.5); // Gen |Vz| cut |
| 2770 | + |
| 2771 | + if (!mcINELgt0) { |
| 2772 | + return; |
2755 | 2773 | } |
| 2774 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 2.5); // Gen True INEL>0 |
2756 | 2775 |
|
| 2776 | + int nRecoColls = 0; |
| 2777 | + int nSelectedRecoColls = 0; |
| 2778 | + bool hasRecoColl = false; |
| 2779 | + bool passSel8 = false; |
| 2780 | + bool passRecoVz = false; |
| 2781 | + bool passExtraEventSel = false; |
| 2782 | + bool hasSelectedRecoColl = false; |
2757 | 2783 | for (const auto& recoColl : recoColls) { |
| 2784 | + ++nRecoColls; |
2758 | 2785 | hasRecoColl = true; |
2759 | | - if (jetderiveddatautilities::selectCollision(recoColl, jetderiveddatautilities::initialiseEventSelectionBits("sel8"))) |
2760 | | - isSel8 = true; |
2761 | | - jetHist.fill(HIST("eventLoss/hEventStatistics"), 3.5); // Has Reco Coll |
| 2786 | + const bool isSel8 = jetderiveddatautilities::selectCollision(recoColl, jetderiveddatautilities::initialiseEventSelectionBits("sel8")); |
| 2787 | + const bool isRecoVz = std::abs(recoColl.posZ()) < cfgMaxZVertex; |
| 2788 | + const bool isNoSameBunchPileup = !selNoSameBunchPileup || jetderiveddatautilities::selectCollision(recoColl, jetderiveddatautilities::initialiseEventSelectionBits("NoSameBunchPileup")); |
| 2789 | + const bool isGoodZvtxFT0vsPV = !selIsGoodZvtxFT0vsPV || jetderiveddatautilities::selectCollision(recoColl, jetderiveddatautilities::initialiseEventSelectionBits("IsGoodZvtxFT0vsPV")); |
| 2790 | + const bool isOccupancy = !useOccupancy || isOccupancyAccepted(recoColl); |
| 2791 | + const bool isExtraEventSel = isNoSameBunchPileup && isGoodZvtxFT0vsPV && isOccupancy; |
2762 | 2792 |
|
2763 | 2793 | if (isSel8) { |
2764 | 2794 | passSel8 = true; |
2765 | | - jetHist.fill(HIST("eventLoss/hEventStatistics"), 4.5); // Pass Sel8 |
2766 | 2795 | } |
2767 | | - |
2768 | | - if (std::abs(recoColl.posZ()) < 10.0) { |
2769 | | - passVz = true; |
2770 | | - jetHist.fill(HIST("eventLoss/hEventStatistics"), 5.5); // Pass |Vz|<10 |
| 2796 | + if (isRecoVz) { |
| 2797 | + passRecoVz = true; |
2771 | 2798 | } |
2772 | | - |
2773 | | - if (mcINELgt0) { |
2774 | | - passINELgt0 = true; |
2775 | | - jetHist.fill(HIST("eventLoss/hEventStatistics"), 6.5); // Pass rec INEL>0 |
| 2799 | + if (isExtraEventSel) { |
| 2800 | + passExtraEventSel = true; |
2776 | 2801 | } |
2777 | 2802 |
|
2778 | | - break; // Only first reco collision |
| 2803 | + if (isSel8 && isRecoVz && isExtraEventSel) { |
| 2804 | + ++nSelectedRecoColls; |
| 2805 | + hasSelectedRecoColl = true; |
| 2806 | + } |
2779 | 2807 | } |
2780 | 2808 |
|
2781 | | - // Final selection (all cuts passed) |
2782 | | - if (hasRecoColl && passSel8 && passVz && passINELgt0) { |
2783 | | - jetHist.fill(HIST("eventLoss/hEventStatistics"), 7.5); // Final Selection |
| 2809 | + jetHist.fill(HIST("eventLoss/hRecoCollPerMCCollVsCent"), nRecoColls, centrality); |
| 2810 | + jetHist.fill(HIST("eventLoss/hSelectedRecoCollPerMCCollVsCent"), nSelectedRecoColls, centrality); |
| 2811 | + |
| 2812 | + if (hasRecoColl) { |
| 2813 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 3.5); // Has Reco Coll |
| 2814 | + } |
| 2815 | + if (passSel8) { |
| 2816 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 4.5); // Pass Sel8 |
| 2817 | + } |
| 2818 | + if (passRecoVz) { |
| 2819 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 5.5); // Pass reco |Vz| cut |
| 2820 | + } |
| 2821 | + if (passExtraEventSel) { |
| 2822 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 6.5); // Pass extra event sel |
| 2823 | + } |
| 2824 | + if (hasSelectedRecoColl) { |
| 2825 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 7.5); // Reco selected |
| 2826 | + jetHist.fill(HIST("eventLoss/hEventStatistics"), 8.5); // Reco selected + true INEL>0 |
2784 | 2827 | } |
2785 | 2828 |
|
2786 | | - auto mcParticles_perColl = mcParticles.sliceBy(perMCCol, mcCollision.globalIndex()); |
2787 | 2829 | for (const auto& mcParticle : mcParticles_perColl) { |
2788 | 2830 | if (!mcParticle.isPhysicalPrimary()) |
2789 | 2831 | continue; |
2790 | 2832 |
|
2791 | 2833 | // Apply kinematic cuts similar to track selection |
2792 | 2834 | if (std::fabs(mcParticle.eta()) > cfgtrkMaxEta) |
2793 | 2835 | continue; |
| 2836 | + if (std::fabs(mcParticle.y()) > cfgtrkMaxRap) |
| 2837 | + continue; |
2794 | 2838 |
|
2795 | 2839 | int particleType = mapPDGToValue(mcParticle.pdgCode()); |
2796 | 2840 | if (particleType == 0) |
2797 | 2841 | continue; // Only interested particles |
2798 | 2842 |
|
2799 | | - // Fill INEL>0 specific histograms |
2800 | | - if (mcINELgt0) { |
2801 | | - jetHist.fill(HIST("eventLoss/signalLoss/h3GenParticlesPtVsEtaVsCent_TrueINELgt0"), mcParticle.pt(), mcParticle.eta(), centrality); |
2802 | | - jetHist.fill(HIST("eventLoss/signalLoss/h3GenParticleTypeVsPtVsCent_TrueINELgt0"), mcParticle.pt(), particleType, centrality); |
2803 | | - } |
| 2843 | + jetHist.fill(HIST("eventLoss/signalLoss/h3GenParticlesPtVsEtaVsCent_TrueINELgt0"), mcParticle.pt(), mcParticle.eta(), centrality); |
| 2844 | + jetHist.fill(HIST("eventLoss/signalLoss/h3GenParticleTypeVsPtVsCent_TrueINELgt0"), mcParticle.pt(), particleType, centrality); |
2804 | 2845 |
|
2805 | | - // Fill generated particle histograms (rec events) |
2806 | | - if (hasRecoColl && passSel8 && passVz && passINELgt0) { |
| 2846 | + if (hasSelectedRecoColl) { |
2807 | 2847 | jetHist.fill(HIST("eventLoss/signalLoss/h3GenParticlesPtVsEtaVsCent_INELgt0"), mcParticle.pt(), mcParticle.eta(), centrality); |
2808 | 2848 | jetHist.fill(HIST("eventLoss/signalLoss/h3GenParticleTypeVsPtVsCent_INELgt0"), mcParticle.pt(), particleType, centrality); |
2809 | 2849 | } |
|
0 commit comments