diff --git a/PWGJE/Tasks/nucleiInJets.cxx b/PWGJE/Tasks/nucleiInJets.cxx index 8b9c88de34d..4bfeab1d2f8 100644 --- a/PWGJE/Tasks/nucleiInJets.cxx +++ b/PWGJE/Tasks/nucleiInJets.cxx @@ -114,6 +114,18 @@ struct nucleiInJets { } } + template + int getParticleOriginType(const T& mcParticle) + { + if (mcParticle.isPhysicalPrimary()) { + return 1; // physical primary + } + if (mcParticle.getProcess() == TMCProcess::kPDecay) { + return 3; // weak-decay feed-down + } + return 2; // other secondary / material / transport + } + Configurable cfgtrackSelections{"cfgtrackSelections", "globalTracks", "set track selections"}; Configurable isMC{"isMC", false, "flag for the MC"}; Configurable isWithJetEvents{"isWithJetEvents", true, "Events with at least one jet"}; @@ -138,6 +150,7 @@ struct nucleiInJets { Configurable cfgnITSChi2{"cfgnITShi2", 36.0, "nITS Chi2 per Cluster"}; Configurable cfgjetPtMin{"cfgjetPtMin", 5.0, "minimum jet pT cut"}; + Configurable cfgjetPtBkgSubMin{"cfgjetPtBkgSubMin", 10.0f, "minimum background-subtracted jet pT cut for data jet-event normalization"}; Configurable cfgjetR{"cfgjetR", 0.4, "jet resolution parameter"}; Configurable cDebugLevel{"cDebugLevel", 0, "print debug msg"}; Configurable cMaxPt{"cMaxPt", 10, "max pt for Hist"}; @@ -166,6 +179,7 @@ struct nucleiInJets { Configurable useMcC{"useMcC", true, "use mcC"}; Configurable usebkgSubractionMC{"usebkgSubractionMC", true, "use rho-area background subtraction for detector-level matched MC jets"}; Configurable cfgjetPtBkgSubMinMC{"cfgjetPtBkgSubMinMC", 10.0f, "minimum detector-level matched MC jet pT after optional background subtraction"}; + Configurable useFullConeAcceptance{"useFullConeAcceptance", true, "require jet/perpendicular-cone axes to satisfy |eta_axis| < cfgtrkMaxEta - cfgjetR for jet and efficiency histograms"}; Configurable useRapidityCutForPID{"useRapidityCutForPID", false, "true: use rapidity cut for PID, false: no rapidity cut for PID"}; Configurable isPOCollision{"isPOCollision", false, "true: use pO rapidity shift for inclusive PID/efficiency rapidity cuts; false: symmetric system, no rapidity shift"}; Configurable cfgPORapidityShiftForPID{"cfgPORapidityShiftForPID", 0.0, "pO rapidity shift for inclusive PID/efficiency rapidity cuts: y_{CMS}=y_{lab}-shift. Set sign/value according to beam convention"}; @@ -188,6 +202,15 @@ struct nucleiInJets { return std::abs(rap) < std::abs(static_cast(cfgtrkMaxRap)); } + bool isConeAxisAccepted(double etaAxis) + { + if (!useFullConeAcceptance) { + return true; + } + const double maxAcceptedConeAxisEta = static_cast(cfgtrkMaxEta) - static_cast(cfgjetR); + return maxAcceptedConeAxisEta > 0. && std::abs(etaAxis) < maxAcceptedConeAxisEta; + } + Configurable addpik{"addpik", true, "add pion and kaon hist"}; ConfigurableAxis binsDCA{"binsDCA", {400, -1.f, 1.f}, ""}; ConfigurableAxis binsdEdx{"binsdEdx", {1000, 0.f, 1000.f}, ""}; @@ -252,6 +275,7 @@ struct nucleiInJets { jetHist.print(); // const AxisSpec PtAxis = {100, 0, 10.0}; const AxisSpec PtJetAxis = {100, 0, 100.0}; + const AxisSpec PtJetBkgSubAxis = {240, -20.f, 100.f, "#it{p}_{T}^{jet,bkg sub} (GeV/#it{c})"}; const AxisSpec MultAxis = {100, 0, 100}; const AxisSpec dRAxis = {100, 0, 3.6}; const AxisSpec CentAxis = {100, 0, 100}; @@ -260,6 +284,7 @@ struct nucleiInJets { const AxisSpec dedxAxis{binsdEdx, "d#it{E}/d#it{x} A.U."}; const AxisSpec vzAxis{300, -15.f, 15.f, "Vz (cm)"}; const AxisSpec EtaAxis{40, -1.f, 1.f, "#eta"}; + const AxisSpec ParticleOriginAxis{3, 0.5, 3.5, "origin: 1 primary, 2 secondary/material, 3 weak decay"}; const AxisSpec betaAxis{binsBeta, "TOF #beta"}; const AxisSpec ptZHeAxis{binsPtZHe, "#it{p}_{T}"}; @@ -270,7 +295,7 @@ struct nucleiInJets { const AxisSpec massHeAxis{binsMassHe, ""}; const AxisSpec PtAxis{ptAxisConf, ""}; - jetHist.add("hNEvents", "hNEvents", {HistType::kTH1D, {{8, 0.f, 8.f}}}); + jetHist.add("hNEvents", "hNEvents", {HistType::kTH1D, {{9, 0.f, 9.f}}}); jetHist.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(1, "All"); jetHist.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(2, "Skimmed"); jetHist.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(3, "|Vz|<10"); @@ -279,6 +304,7 @@ struct nucleiInJets { jetHist.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(6, "isGoodZvtxFT0vsPV"); jetHist.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(7, "OccupancySel"); jetHist.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(8, "nJets>0"); + jetHist.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(9, "leading jet bkg-sub pT cut"); jetHist.add("hNEventsInc", "hNEventsInc", {HistType::kTH1D, {{6, 0.f, 6.f}}}); jetHist.get(HIST("hNEventsInc"))->GetXaxis()->SetBinLabel(1, "All"); @@ -302,12 +328,21 @@ struct nucleiInJets { jetHist.add("jet/h2JetPtVsBkgRho", "jet_{p_{T}} vs background #rho; jet_{p_{T}} (GeV/c); #rho (GeV/c/area)", kTH2F, {PtJetAxis, {100, 0, 20}}); jetHist.add("jet/h1BkgRho", "Background #rho; #rho (GeV/c/area); Entries", kTH1F, {{100, 0, 20}}); jetHist.add("jet/h1JetEvents", "NumbeOfJetEvents", kTH1F, {{1, 0, 1}}); + jetHist.add("jetBkgSub/h1JetEvents", "Number of jet events with leading p_{T}^{jet,bkg sub} above cfgjetPtBkgSubMin", kTH1F, {{1, 0, 1}}); + jetHist.add("jetBkgSub/h1BkgRhoLeadingJetPtBkgSubAboveCut", "Background #rho for events with leading p_{T}^{jet,bkg sub} above cfgjetPtBkgSubMin; #rho (GeV/#it{c}/area); Entries", kTH1F, {{100, 0, 20}}); jetHist.add("jet/h1JetEta", "jet_{#eta}", kTH1F, {{100, -1.0, 1.0}}); jetHist.add("jet/h1JetPhi", "jet_{#phi}", kTH1F, {{80, -1.0, 7.}}); jetHist.add("jet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}}); + jetHist.add("jet/qa/h2JetConeEtaPhiBeforeAcceptance", "jet-cone axis before full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}}); + jetHist.add("jet/qa/h2JetConeEtaPhiAfterAcceptance", "jet-cone axis after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}}); + jetHist.add("jet/qa/h2PerpConeEtaPhiAfterAcceptance", "perpendicular-cone axes after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}}); + jetHist.add("jet/qa/nAcceptedJetsPerEvent", "number of full-cone-accepted jets per event;N_{jets};Entries", kTH1F, {{15, .0, 15.}}); + jetHist.add("jetBkgSub/h1LeadingJetPtBkgSub", "leading jet background-subtracted #it{p}_{T}; #it{p}_{T}^{jet,bkg sub} (GeV/#it{c}); Entries", kTH1F, {PtJetBkgSubAxis}); + jetHist.add("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ", "leading jet background-subtracted #it{p}_{T} vs V_{z}; #it{p}_{T}^{jet,bkg sub} (GeV/#it{c}); V_{z} (cm)", kTH2F, {PtJetBkgSubAxis, vzAxis}); jetHist.add("mcpJet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}}); jetHist.add("mcdJet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}}); jetHist.add("jet/vertexZ", "vertexZ (Jet flag)", kTH1F, {{vzAxis}}); + jetHist.add("jetBkgSub/vertexZ", "vertexZ for events with p_{T}^{jet,bkg sub} above cfgjetPtBkgSubMin; V_{z} (cm); Entries", kTH1F, {{vzAxis}}); jetHist.add("vertexZ", "vertexZ (all)", kTH1F, {{vzAxis}}); jetHist.add("jetOut/vertexZ", "vertexZ (without z-flag)", kTH1F, {{vzAxis}}); //////////////////////////// @@ -736,6 +771,9 @@ struct nucleiInJets { jetHist.add("recmatched/h2ResponseMatrix", "matched jet pT;#it{p}_{T} (mes.); #it{p}_{T} (true)", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}); jetHist.add("recmatched/h2ResponseMatrixLeadingJet", "matched jet rec pT vs true pt;#it{p}_{T} (mes.); #it{p}_{T} (true)", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}); jetHist.add("recmatched/mcC/h2ResponseMatrixLeadingJet", "matched jet rec pT vs true pt;#it{p}_{T} (mes.); #it{p}_{T} (true)", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}); + jetHist.add("recmatched/qa/h2JetConeEtaPhiBeforeAcceptance", "matched jet-cone axis before full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}}); + jetHist.add("recmatched/qa/h2JetConeEtaPhiAfterAcceptance", "matched jet-cone axis after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}}); + jetHist.add("recmatched/qa/h2PerpConeEtaPhiAfterAcceptance", "matched perpendicular-cone axes after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}}); ///////// jetHist.add("recmatched/hRecJetPt", "matched jet pT (Rec level);#it{p}_{T,jet part} (GeV/#it{c}); #it{p}_{T,jet part} - #it{p}_{T,jet det}", HistType::kTH1F, {{100, 0., 100.}}); @@ -776,6 +814,17 @@ struct nucleiInJets { jetHist.add("eff/recmatched/mcCSpectra/gen/pt/PtParticleType", "Pt (gen, mcCSpectra) vs jetflag vs particletype", HistType::kTH3D, {{PtAxis}, {2, 0, 2}, {14, -7, 7}}); jetHist.add("eff/recmatched/mcC/gen/perpCone/pt/PtParticleType", "Pt (gen, mcC, perp cone) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}}); jetHist.add("eff/recmatched/mcCSpectra/gen/perpCone/pt/PtParticleType", "Pt (gen, mcCSpectra, perp cone) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}}); + + jetHist.add("feeddown/antiProton/jetCone/PtOrigin", "reconstructed #bar{p} origin in jet cone; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/jetCone/PtOriginTPC", "reconstructed #bar{p} origin in jet cone, TPC PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/jetCone/PtOriginTOF", "reconstructed #bar{p} origin in jet cone, TOF matched; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/jetCone/PtOriginTPCTOF", "reconstructed #bar{p} origin in jet cone, TPC+TOF PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/jetCone/PtOriginTPCTOFVeto", "reconstructed #bar{p} origin in jet cone, TPC+TOF veto; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/perpCone/PtOrigin", "reconstructed #bar{p} origin in perpendicular cone; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/perpCone/PtOriginTPC", "reconstructed #bar{p} origin in perpendicular cone, TPC PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/perpCone/PtOriginTOF", "reconstructed #bar{p} origin in perpendicular cone, TOF matched; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/perpCone/PtOriginTPCTOF", "reconstructed #bar{p} origin in perpendicular cone, TPC+TOF PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); + jetHist.add("feeddown/antiProton/perpCone/PtOriginTPCTOFVeto", "reconstructed #bar{p} origin in perpendicular cone, TPC+TOF veto; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}}); // gen matched jetHist.add("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.}}); jetHist.add("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.}}); @@ -892,6 +941,9 @@ struct nucleiInJets { float jetPt = -999.; if (isWithLeadingJet) { + if (!isConeAxisAccepted(leadingJetPtEtaPhi[1])) { + return; + } double delPhi = TVector2::Phi_mpi_pi(leadingJetPtEtaPhi[2] - trk.phi()); double delEta = leadingJetPtEtaPhi[1] - trk.eta(); double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi); @@ -908,13 +960,17 @@ struct nucleiInJets { jetFlagPerpCone = true; } else { for (auto const& jet : jets) { + if (!isConeAxisAccepted(jet.eta())) { + continue; + } double delPhi = TVector2::Phi_mpi_pi(jet.phi() - trk.phi()); double delEta = jet.eta() - trk.eta(); double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi); - if (R < cfgjetR) + if (R < cfgjetR) { jetFlag = true; - jetPt = jet.pt(); - break; + jetPt = jet.pt(); + break; + } } } // tof @@ -1697,8 +1753,10 @@ struct nucleiInJets { return; jetHist.fill(HIST("hNEvents"), 6.5); int nJets = 0; + int nAcceptedJets = 0; std::vector leadingJetWithPtEtaPhi(3); float leadingJetPt = -1.0f; + float leadingJetPtBkgSub = -999.0f; float backgroundRho = collision.rho(); // Get background rho from collision // Fill background rho histogram once per event @@ -1708,6 +1766,7 @@ struct nucleiInJets { jetHist.fill(HIST("jet/h1JetPt"), chargedjet.pt()); jetHist.fill(HIST("jet/h1JetEta"), chargedjet.eta()); jetHist.fill(HIST("jet/h1JetPhi"), chargedjet.phi()); + jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiBeforeAcceptance"), chargedjet.eta(), chargedjet.phi()); // Calculate background subtracted jet pt float jetArea = M_PI * cfgjetR * cfgjetR; // Assuming circular jet area @@ -1717,7 +1776,17 @@ struct nucleiInJets { jetHist.fill(HIST("jet/h1JetPtBkgSub"), jetPtBkgSub); jetHist.fill(HIST("jet/h2JetPtVsBkgRho"), chargedjet.pt(), backgroundRho); - if (chargedjet.pt() > leadingJetPt) { + if (isConeAxisAccepted(chargedjet.eta())) { + const auto perpConePhiJet = getPerpendicuarPhi(chargedjet.phi()); + jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiAfterAcceptance"), chargedjet.eta(), chargedjet.phi()); + jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[0]); + jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[1]); + nAcceptedJets++; + } + + if (isConeAxisAccepted(chargedjet.eta()) && chargedjet.pt() > leadingJetPt) { + leadingJetPt = chargedjet.pt(); + leadingJetPtBkgSub = jetPtBkgSub; leadingJetWithPtEtaPhi[0] = chargedjet.pt(); leadingJetWithPtEtaPhi[1] = chargedjet.eta(); leadingJetWithPtEtaPhi[2] = chargedjet.phi(); @@ -1725,6 +1794,7 @@ struct nucleiInJets { nJets++; } jetHist.fill(HIST("jet/nJetsPerEvent"), nJets); + jetHist.fill(HIST("jet/qa/nAcceptedJetsPerEvent"), nAcceptedJets); jetHist.fill(HIST("vertexZ"), collision.posZ()); if (nJets > 0) { jetHist.fill(HIST("jet/vertexZ"), collision.posZ()); @@ -1732,9 +1802,23 @@ struct nucleiInJets { } else { jetHist.fill(HIST("jetOut/vertexZ"), collision.posZ()); } + if (nAcceptedJets > 0) { + jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub); + jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ()); + } + if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) { + jetHist.fill(HIST("jetBkgSub/vertexZ"), collision.posZ()); + jetHist.fill(HIST("jetBkgSub/h1BkgRhoLeadingJetPtBkgSubAboveCut"), backgroundRho); + jetHist.fill(HIST("hNEvents"), 8.5); + } if (isWithJetEvents && nJets == 0) return; + if (isWithJetEvents && nAcceptedJets == 0) + return; jetHist.fill(HIST("jet/h1JetEvents"), 0.5); + if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) { + jetHist.fill(HIST("jetBkgSub/h1JetEvents"), 0.5); + } for (const auto& track : tracks) { auto trk = track.track_as(); fillTrackInfo(trk, chargedjets, leadingJetWithPtEtaPhi, backgroundRho); @@ -1771,8 +1855,10 @@ struct nucleiInJets { return; jetHist.fill(HIST("hNEvents"), 6.5); int nJets = 0; + int nAcceptedJets = 0; std::vector leadingJetWithPtEtaPhi(3); float leadingJetPt = -1.0f; + float leadingJetPtBkgSub = -999.0f; float backgroundRho = collision.rho(); // Get background rho from collision // Fill background rho histogram once per event @@ -1782,6 +1868,7 @@ struct nucleiInJets { jetHist.fill(HIST("jet/h1JetPt"), chargedjet.pt()); jetHist.fill(HIST("jet/h1JetEta"), chargedjet.eta()); jetHist.fill(HIST("jet/h1JetPhi"), chargedjet.phi()); + jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiBeforeAcceptance"), chargedjet.eta(), chargedjet.phi()); // Calculate background subtracted jet pt float jetArea = M_PI * cfgjetR * cfgjetR; // Assuming circular jet area @@ -1791,7 +1878,17 @@ struct nucleiInJets { jetHist.fill(HIST("jet/h1JetPtBkgSub"), jetPtBkgSub); jetHist.fill(HIST("jet/h2JetPtVsBkgRho"), chargedjet.pt(), backgroundRho); - if (chargedjet.pt() > leadingJetPt) { + if (isConeAxisAccepted(chargedjet.eta())) { + const auto perpConePhiJet = getPerpendicuarPhi(chargedjet.phi()); + jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiAfterAcceptance"), chargedjet.eta(), chargedjet.phi()); + jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[0]); + jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[1]); + nAcceptedJets++; + } + + if (isConeAxisAccepted(chargedjet.eta()) && chargedjet.pt() > leadingJetPt) { + leadingJetPt = chargedjet.pt(); + leadingJetPtBkgSub = jetPtBkgSub; leadingJetWithPtEtaPhi[0] = chargedjet.pt(); leadingJetWithPtEtaPhi[1] = chargedjet.eta(); leadingJetWithPtEtaPhi[2] = chargedjet.phi(); @@ -1799,6 +1896,7 @@ struct nucleiInJets { nJets++; } jetHist.fill(HIST("jet/nJetsPerEvent"), nJets); + jetHist.fill(HIST("jet/qa/nAcceptedJetsPerEvent"), nAcceptedJets); jetHist.fill(HIST("vertexZ"), collision.posZ()); if (nJets > 0) { jetHist.fill(HIST("jet/vertexZ"), collision.posZ()); @@ -1806,9 +1904,23 @@ struct nucleiInJets { } else { jetHist.fill(HIST("jetOut/vertexZ"), collision.posZ()); } + if (nAcceptedJets > 0) { + jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub); + jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ()); + } + if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) { + jetHist.fill(HIST("jetBkgSub/vertexZ"), collision.posZ()); + jetHist.fill(HIST("jetBkgSub/h1BkgRhoLeadingJetPtBkgSubAboveCut"), backgroundRho); + jetHist.fill(HIST("hNEvents"), 8.5); + } if (isWithJetEvents && nJets == 0) return; + if (isWithJetEvents && nAcceptedJets == 0) + return; jetHist.fill(HIST("jet/h1JetEvents"), 0.5); + if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) { + jetHist.fill(HIST("jetBkgSub/h1JetEvents"), 0.5); + } for (auto& track : tracks) { auto trk = track.track_as(); fillTrackInfo(trk, chargedjets, leadingJetWithPtEtaPhi, backgroundRho); @@ -2152,10 +2264,10 @@ struct nucleiInJets { double delPhi = TVector2::Phi_mpi_pi(mcpjet.phi() - mcParticle.phi()); double delEta = mcpjet.eta() - mcParticle.eta(); double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi); - if (R < cfgjetR) + if (R < cfgjetR) { jetFlag = true; - // jetPt = mcpjet.pt(); - break; + break; + } } // jet if (mapPDGToValue(mcParticle.pdgCode()) != 0) { jetHist.fill(HIST("mcpJet/pt/PtParticleType"), mcParticle.pt(), jetFlag, mapPDGToValue(mcParticle.pdgCode())); @@ -2185,6 +2297,7 @@ struct nucleiInJets { jetHist.fill(HIST("mcdJet/hJetEta"), mcdjet.eta()); jetHist.fill(HIST("mcdJet/hJetPhi"), mcdjet.phi()); if (mcdjet.pt() > leadingJetPt) { + leadingJetPt = mcdjet.pt(); leadingJetWithPtEtaPhi[0] = mcdjet.pt(); leadingJetWithPtEtaPhi[1] = mcdjet.eta(); leadingJetWithPtEtaPhi[2] = mcdjet.phi(); @@ -2227,10 +2340,10 @@ struct nucleiInJets { double delPhi = TVector2::Phi_mpi_pi(mcdjet.phi() - track.phi()); double delEta = mcdjet.eta() - track.eta(); double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi); - if (R < cfgjetR) + if (R < cfgjetR) { jetFlag = true; - // jetPt = mcdjet.pt(); - break; + break; + } } // jet } if (mapPDGToValue(mcTrack.pdgCode()) != 0) { @@ -2284,6 +2397,16 @@ struct nucleiInJets { if (mcdJetPtForResponse < cfgjetPtBkgSubMinMC) { continue; } + const double jetAxisEtaForEff = isWithLeadingJet ? (useLeadingJetDetLevelValue ? mcdjet.eta() : mcpjet.eta()) : mcdjet.eta(); + const double jetAxisPhiForEff = isWithLeadingJet ? (useLeadingJetDetLevelValue ? mcdjet.phi() : mcpjet.phi()) : mcdjet.phi(); + jetHist.fill(HIST("recmatched/qa/h2JetConeEtaPhiBeforeAcceptance"), jetAxisEtaForEff, jetAxisPhiForEff); + if (!isConeAxisAccepted(jetAxisEtaForEff)) { + continue; + } + const auto perpConePhiJet = getPerpendicuarPhi(static_cast(jetAxisPhiForEff)); + jetHist.fill(HIST("recmatched/qa/h2JetConeEtaPhiAfterAcceptance"), jetAxisEtaForEff, jetAxisPhiForEff); + jetHist.fill(HIST("recmatched/qa/h2PerpConeEtaPhiAfterAcceptance"), jetAxisEtaForEff, perpConePhiJet[0]); + jetHist.fill(HIST("recmatched/qa/h2PerpConeEtaPhiAfterAcceptance"), jetAxisEtaForEff, perpConePhiJet[1]); mcdJetPt.push_back(mcdJetPtForResponse); mcdJetPhi.push_back(mcdjet.phi()); mcdJetEta.push_back(mcdjet.eta()); @@ -2338,8 +2461,6 @@ struct nucleiInJets { if (!track.has_mcParticle()) continue; auto mcTrack = track.mcParticle_as(); - if (!mcTrack.isPhysicalPrimary()) - continue; if (!isRapiditySelectedForPID(mcTrack.y())) continue; @@ -2373,30 +2494,75 @@ struct nucleiInJets { } } // jet + if (mapPDGToValue(mcTrack.pdgCode()) == -Particle::kProton) { + const int particleOriginType = getParticleOriginType(mcTrack); + const bool isAntiProtonTpcPassed = std::abs(completeTrack.tpcNSigmaPr()) < cfgnTPCPIDPr; + const bool isAntiProtonTofPidPassed = isTof && std::abs(completeTrack.tofNSigmaPr()) < cfgnTPCPIDPrTOF; + const bool isAntiProtonTPCTOFPassed = isAntiProtonTpcPassed && isAntiProtonTofPidPassed; + const bool isAntiProtonTPCTOFVetoPassed = isAntiProtonTpcPassed && (!isTof || isAntiProtonTofPidPassed); + + if (jetFlag) { + jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOrigin"), completeTrack.pt(), particleOriginType); + if (isAntiProtonTpcPassed) { + jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTPC"), completeTrack.pt(), particleOriginType); + } + if (isTof) { + jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTOF"), completeTrack.pt(), particleOriginType); + } + if (isAntiProtonTPCTOFPassed) { + jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTPCTOF"), completeTrack.pt(), particleOriginType); + } + if (isAntiProtonTPCTOFVetoPassed) { + jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTPCTOFVeto"), completeTrack.pt(), particleOriginType); + } + } + + if (jetFlagPerpCone) { + jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOrigin"), completeTrack.pt(), particleOriginType); + if (isAntiProtonTpcPassed) { + jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTPC"), completeTrack.pt(), particleOriginType); + } + if (isTof) { + jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTOF"), completeTrack.pt(), particleOriginType); + } + if (isAntiProtonTPCTOFPassed) { + jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTPCTOF"), completeTrack.pt(), particleOriginType); + } + if (isAntiProtonTPCTOFVetoPassed) { + jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTPCTOFVeto"), completeTrack.pt(), particleOriginType); + } + } + } + + if (!mcTrack.isPhysicalPrimary()) + continue; + const auto particleType = mapPDGToValue(mcTrack.pdgCode()); if (particleType != 0) { bool isTpcPassed = true; - bool isTOFAndTPCPreSel = isTof; + bool isTofPidPassed = isTof; switch (std::abs(particleType)) { case Particle::kProton: isTpcPassed = std::abs(completeTrack.tpcNSigmaPr()) < cfgnTPCPIDPr; - isTOFAndTPCPreSel = isTof && std::abs(completeTrack.tpcNSigmaPr()) < cfgnTPCPIDPrTOF; + isTofPidPassed = isTof && std::abs(completeTrack.tofNSigmaPr()) < cfgnTPCPIDPrTOF; break; case Particle::kDeuteron: isTpcPassed = std::abs(completeTrack.tpcNSigmaDe()) < cfgnTPCPIDDe; - isTOFAndTPCPreSel = isTof && std::abs(completeTrack.tpcNSigmaDe()) < cfgnTPCPIDDeTOF; + isTofPidPassed = isTof && std::abs(completeTrack.tofNSigmaDe()) < cfgnTPCPIDDeTOF; break; case Particle::kTriton: isTpcPassed = std::abs(completeTrack.tpcNSigmaTr()) < cfgnTPCPIDTr; - isTOFAndTPCPreSel = isTof && std::abs(completeTrack.tpcNSigmaTr()) < cfgnTPCPIDTrTOF; + isTofPidPassed = isTof && std::abs(completeTrack.tofNSigmaTr()) < cfgnTPCPIDTrTOF; break; case Particle::kHelium: isTpcPassed = std::abs(completeTrack.tpcNSigmaHe()) < cfgnTPCPIDHe; - isTOFAndTPCPreSel = isTof && std::abs(completeTrack.tpcNSigmaHe()) < cfgnTPCPIDHeTOF; + isTofPidPassed = isTof && std::abs(completeTrack.tofNSigmaHe()) < cfgnTPCPIDHeTOF; break; default: break; } + const bool isTPCTOFPassed = isTpcPassed && isTofPidPassed; + const bool isTPCTOFVetoPassed = isTpcPassed && (!isTof || isTofPidPassed); jetHist.fill(HIST("eff/recmatched/pt/PtParticleType"), mcTrack.pt(), jetFlag, particleType); if (useMcC) { if (useDataLikeHist) @@ -2408,12 +2574,10 @@ struct nucleiInJets { jetHist.fill(HIST("eff/recmatched/pt/PtParticleTypeTPC"), mcTrack.pt(), jetFlag, particleType); if (isTof) jetHist.fill(HIST("eff/recmatched/pt/PtParticleTypeTOF"), mcTrack.pt(), jetFlag, particleType); - if (isTOFAndTPCPreSel) { + if (isTPCTOFPassed) jetHist.fill(HIST("eff/recmatched/pt/PtParticleTypeTPCTOF"), mcTrack.pt(), jetFlag, particleType); + if (isTPCTOFVetoPassed) jetHist.fill(HIST("eff/recmatched/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), jetFlag, particleType); - } else { - jetHist.fill(HIST("eff/recmatched/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), jetFlag, particleType); - } if (jetFlag) { jetHist.fill(HIST("eff/recmatched/jetCone/ptEta/PtEtaParticleType"), mcTrack.pt(), mcTrack.eta(), particleType); @@ -2421,12 +2585,10 @@ struct nucleiInJets { jetHist.fill(HIST("eff/recmatched/jetCone/ptEta/PtEtaParticleTypeTPC"), mcTrack.pt(), mcTrack.eta(), particleType); if (isTof) jetHist.fill(HIST("eff/recmatched/jetCone/ptEta/PtEtaParticleTypeTOF"), mcTrack.pt(), mcTrack.eta(), particleType); - if (isTOFAndTPCPreSel) { + if (isTPCTOFPassed) jetHist.fill(HIST("eff/recmatched/jetCone/ptEta/PtEtaParticleTypeTPCTOF"), mcTrack.pt(), mcTrack.eta(), particleType); + if (isTPCTOFVetoPassed) jetHist.fill(HIST("eff/recmatched/jetCone/ptEta/PtEtaParticleTypeTPCTOFVeto"), mcTrack.pt(), mcTrack.eta(), particleType); - } else { - jetHist.fill(HIST("eff/recmatched/jetCone/ptEta/PtEtaParticleTypeTPCTOFVeto"), mcTrack.pt(), mcTrack.eta(), particleType); - } } if (jetFlagPerpCone) { @@ -2446,12 +2608,11 @@ struct nucleiInJets { jetHist.fill(HIST("eff/recmatched/perpCone/pt/PtParticleTypeTOF"), mcTrack.pt(), particleType); jetHist.fill(HIST("eff/recmatched/perpCone/ptEta/PtEtaParticleTypeTOF"), mcTrack.pt(), mcTrack.eta(), particleType); } - if (isTOFAndTPCPreSel) { + if (isTPCTOFPassed) { jetHist.fill(HIST("eff/recmatched/perpCone/pt/PtParticleTypeTPCTOF"), mcTrack.pt(), particleType); jetHist.fill(HIST("eff/recmatched/perpCone/ptEta/PtEtaParticleTypeTPCTOF"), mcTrack.pt(), mcTrack.eta(), particleType); - jetHist.fill(HIST("eff/recmatched/perpCone/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), particleType); - jetHist.fill(HIST("eff/recmatched/perpCone/ptEta/PtEtaParticleTypeTPCTOFVeto"), mcTrack.pt(), mcTrack.eta(), particleType); - } else { + } + if (isTPCTOFVetoPassed) { jetHist.fill(HIST("eff/recmatched/perpCone/pt/PtParticleTypeTPCTOFVeto"), mcTrack.pt(), particleType); jetHist.fill(HIST("eff/recmatched/perpCone/ptEta/PtEtaParticleTypeTPCTOFVeto"), mcTrack.pt(), mcTrack.eta(), particleType); }