From 16d65874f7b07b270b601549867cf66d6ae71a30 Mon Sep 17 00:00:00 2001 From: HANSEO PARK <53218370+hanseopark@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:11:50 +0200 Subject: [PATCH 01/60] fix MCP (#7540) --- PWGJE/TableProducer/jettaggerhf.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/TableProducer/jettaggerhf.cxx b/PWGJE/TableProducer/jettaggerhf.cxx index 143611aa87a..3d055f6901e 100644 --- a/PWGJE/TableProducer/jettaggerhf.cxx +++ b/PWGJE/TableProducer/jettaggerhf.cxx @@ -329,7 +329,7 @@ struct JetTaggerHFTask { } PROCESS_SWITCH(JetTaggerHFTask, processMCDWithSV, "Fill tagging decision for mcd jets with sv", false); - void processMCP(JetCollision const& /*collision*/, JetTableMCP const& mcpjets, JetParticles const& particles) + void processMCP(JetMcCollision const& /*collision*/, JetTableMCP const& mcpjets, JetParticles const& particles) { for (auto& mcpjet : mcpjets) { bool flagtaggedjetIP = 0; From 66d36edbcb1801a0d8e4ca72c56bd0e51d5450c1 Mon Sep 17 00:00:00 2001 From: alcaliva <32872606+alcaliva@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:13:41 +0200 Subject: [PATCH 02/60] wider eta coverage + bug fix (return->continue) (#7546) --- PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx index 99a27b32d01..95c2e49e323 100644 --- a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx +++ b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx @@ -180,9 +180,9 @@ struct nuclei_in_jets { registryMC.add("antiproton_all_ue", "antiproton_all_ue", HistType::kTH1F, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}}); // Antiproton Reweighting - registryMC.add("antiproton_eta_pt_pythia", "antiproton_eta_pt_pythia", HistType::kTH2F, {{200, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}, {16, -0.8, 0.8, "#it{#eta}"}}); - registryMC.add("antiproton_eta_pt_jet", "antiproton_eta_pt_jet", HistType::kTH2F, {{200, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}, {16, -0.8, 0.8, "#it{#eta}"}}); - registryMC.add("antiproton_eta_pt_ue", "antiproton_eta_pt_ue", HistType::kTH2F, {{200, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}, {16, -0.8, 0.8, "#it{#eta}"}}); + registryMC.add("antiproton_eta_pt_pythia", "antiproton_eta_pt_pythia", HistType::kTH2F, {{200, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}, {20, -1.0, 1.0, "#it{#eta}"}}); + registryMC.add("antiproton_eta_pt_jet", "antiproton_eta_pt_jet", HistType::kTH2F, {{200, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}, {20, -1.0, 1.0, "#it{#eta}"}}); + registryMC.add("antiproton_eta_pt_ue", "antiproton_eta_pt_ue", HistType::kTH2F, {{200, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}, {20, -1.0, 1.0, "#it{#eta}"}}); } // Single-Track Selection for Particles inside Jets @@ -748,12 +748,16 @@ struct nuclei_in_jets { { for (const auto& collision : collisions) { + registryMC.fill(HIST("number_of_events_mc"), 3.5); + // Event Selection if (!collision.sel8()) continue; + registryMC.fill(HIST("number_of_events_mc"), 4.5); if (abs(collision.posZ()) > zVtx) continue; + registryMC.fill(HIST("number_of_events_mc"), 5.5); auto tracks_per_coll = mcTracks.sliceBy(perCollision, collision.globalIndex()); @@ -871,7 +875,8 @@ struct nuclei_in_jets { isSelected[i] = 1; } if (n_jets_selected == 0) - return; + continue; + registryMC.fill(HIST("number_of_events_mc"), 6.5); for (int i = 0; i < static_cast(jet.size()); i++) { @@ -928,9 +933,12 @@ struct nuclei_in_jets { { for (const auto& mccollision : mcCollisions) { + registryMC.fill(HIST("number_of_events_mc"), 7.5); + // Selection on z_{vertex} if (abs(mccollision.posZ()) > 10) continue; + registryMC.fill(HIST("number_of_events_mc"), 8.5); // MC Particles per Collision auto mcParticles_per_coll = mcParticles.sliceBy(perMCCollision, mccollision.globalIndex()); @@ -1107,7 +1115,7 @@ struct nuclei_in_jets { isSelected[i] = 1; } if (n_jets_selected == 0) - return; + continue; for (int i = 0; i < static_cast(jet.size()); i++) { From aab02399da8021d6e8b5bf0de8ab052b31f29520 Mon Sep 17 00:00:00 2001 From: Archita-Dash <91664849+Archita-Dash@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:14:52 +0200 Subject: [PATCH 03/60] implementation of proper jet matching with emcal fiducial cuts (#7544) * proper jet matching+ more QA histos * fixed bugs * added more QA histos for matched jets * fixed linter * Please consider the following formatting changes --------- Co-authored-by: ALICE Action Bot --- PWGJE/Tasks/fulljetspectrapp.cxx | 409 +++++++++++++++++++++++-------- 1 file changed, 308 insertions(+), 101 deletions(-) diff --git a/PWGJE/Tasks/fulljetspectrapp.cxx b/PWGJE/Tasks/fulljetspectrapp.cxx index 22cb870d487..de0f94b0494 100644 --- a/PWGJE/Tasks/fulljetspectrapp.cxx +++ b/PWGJE/Tasks/fulljetspectrapp.cxx @@ -12,7 +12,7 @@ // FullJet Spectra in pp // // TO DO: -// 1. implement HadCorr and NEF for matched jets +// 1. implement HadCorr // /// \author Archita Rani Dash #include @@ -40,6 +40,7 @@ #include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/EMCALMatchedCollisions.h" #include "PWGJE/Core/JetFinder.h" +#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetFindingUtilities.h" @@ -63,26 +64,27 @@ struct FullJetSpectrapp { Configurable centralityMax{"centralityMax", 999.0, "maximum centrality"}; Configurable doEMCALEventWorkaround{"doEMCALEventWorkaround", false, "apply the workaround to read the EMC trigger bit by requiring a cell content in the EMCAL"}; Configurable doMBGapTrigger{"doMBGapTrigger", false, "set to true only when using MB-Gap Trigger JJ MC"}; + Configurable doJJMC{"doJJMC", false, "set to true only when using JJ MC"}; // Jet configurables Configurable selectedJetsRadius{"selectedJetsRadius", 0.4, "resolution parameter for histograms without radius"}; Configurable> jetRadii{"jetRadii", std::vector{0.4}, "jet resolution parameters"}; - Configurable jetpTMin{"jetpTMin", 10.0, "minimum jet pT"}; + Configurable jetpTMin{"jetpTMin", 20.0, "minimum jet pT"}; Configurable jetpTMax{"jetpTMax", 350., "maximum jet pT"}; - Configurable jetEtaMin{"jetEtaMin", -1.0, "minimum jet eta"}; - Configurable jetEtaMax{"jetEtaMax", 0.3, "maximum jet eta"}; // for now just hard-coding this value for R = 0.4 (EMCAL eta acceptance: eta_jet = 0.7 - R) - Configurable jetPhiMin{"jetPhiMin", 1.79, "minimum jet phi"}; // phi_jet_min for R = 0.4 is 1.80 - Configurable jetPhiMax{"jetPhiMax", 2.87, "maximum jet phi"}; // phi_jet_min for R = 0.4 is 2.86 + Configurable jetEtaMin{"jetEtaMin", -0.3, "minimum jet eta"}; // each of these jet configurables are for the fiducial emcal cuts + Configurable jetEtaMax{"jetEtaMax", 0.3, "maximum jet eta"}; // for R = 0.4 (EMCAL eta acceptance: eta_jet = 0.7 - R) + Configurable jetPhiMin{"jetPhiMin", 1.80, "minimum jet phi"}; // phi_jet_min for R = 0.4 is 1.80 + Configurable jetPhiMax{"jetPhiMax", 2.86, "maximum jet phi"}; // phi_jet_min for R = 0.4 is 2.86 Configurable jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; Configurable leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"}; // Track configurables Configurable trackpTMin{"trackpTMin", 0.15, "minimum track pT"}; Configurable trackpTMax{"trackpTMax", 350., "maximum track pT"}; - Configurable trackEtaMin{"trackEtaMin", -1.0, "minimum track eta"}; - Configurable trackEtaMax{"trackEtaMax", 0.70, "maximum track eta"}; // emcal eta_track cut - Configurable trackPhiMin{"trackPhiMin", 0., "minimum track phi"}; - Configurable trackPhiMax{"trackPhiMax", 7., "maximum track phi"}; + Configurable trackEtaMin{"trackEtaMin", -0.7, "minimum track eta"}; + Configurable trackEtaMax{"trackEtaMax", 0.7, "maximum track eta"}; + Configurable trackPhiMin{"trackPhiMin", 1.396, "minimum track phi"}; + Configurable trackPhiMax{"trackPhiMax", 3.283, "maximum track phi"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; Configurable eventSelections{"eventSelections", "sel8Full", "choose event selection"}; Configurable particleSelections{"particleSelections", "PhysicalPrimary", "set particle selections"}; @@ -92,8 +94,8 @@ struct FullJetSpectrapp { Configurable clusterDefinitionS{"clusterDefinition", "kV3Default", "cluster definition to be selected, e.g. V3Default"}; Configurable clusterEtaMin{"clusterEtaMin", -0.7, "minimum cluster eta"}; Configurable clusterEtaMax{"clusterEtaMax", 0.7, "maximum cluster eta"}; - Configurable clusterPhiMin{"clusterPhiMin", 1.39, "minimum cluster phi"}; - Configurable clusterPhiMax{"clusterPhiMax", 3.27, "maximum cluster phi"}; + Configurable clusterPhiMin{"clusterPhiMin", 1.396, "minimum cluster phi"}; + Configurable clusterPhiMax{"clusterPhiMax", 3.283, "maximum cluster phi"}; Configurable clusterEnergyMin{"clusterEnergyMin", 0.3, "minimum cluster energy in EMCAL (GeV)"}; Configurable clusterTimeMin{"clusterTimeMin", -20., "minimum cluster time (ns)"}; Configurable clusterTimeMax{"clusterTimeMax", 15., "maximum cluster time (ns)"}; @@ -101,7 +103,7 @@ struct FullJetSpectrapp { 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 pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; + Configurable pTHatExponent{"pTHatExponent", 4.0, "exponent of the event weight for the calculation of pTHat"}; // 6 for MB MC and 4 for JJ MC int trackSelection = -1; int eventSelection = -1; @@ -115,26 +117,30 @@ struct FullJetSpectrapp { // Add Collision Histograms' Bin Labels for clarity void labelCollisionHistograms(HistogramRegistry& registry) { - auto h_collisions_unweighted = registry.get(HIST("h_collisions_unweighted")); - h_collisions_unweighted->GetXaxis()->SetBinLabel(2, "total events"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(3, "JetsData with kTVXinEMC"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(4, "JetsMCD with kTVXinEMC"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(5, "Tracks with kTVXinEMC"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(6, "JetsMCPMCDMatched with kTVXinEMC"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(7, "JetsData w/o kTVXinEMC"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(8, "JetsMCD w/o kTVXinEMC"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(9, "Tracks w/o kTVXinEMC"); - h_collisions_unweighted->GetXaxis()->SetBinLabel(10, "JetsMCPMCDMatched w/o kTVXinEMC"); + if (doprocessTracks) { + auto h_collisions_unweighted = registry.get(HIST("h_collisions_unweighted")); + h_collisions_unweighted->GetXaxis()->SetBinLabel(1, "total events"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(2, "JetsData with kTVXinEMC"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(3, "JetsMCD with kTVXinEMC"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(4, "Tracks with kTVXinEMC"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(5, "JetsMCPMCDMatched with kTVXinEMC"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(6, "JetsData w/o kTVXinEMC"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(7, "JetsMCD w/o kTVXinEMC"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(8, "Tracks w/o kTVXinEMC"); + h_collisions_unweighted->GetXaxis()->SetBinLabel(9, "JetsMCPMCDMatched w/o kTVXinEMC"); + } if (doprocessTracksWeighted) { auto h_collisions_weighted = registry.get(HIST("h_collisions_weighted")); - h_collisions_weighted->GetXaxis()->SetBinLabel(2, "total events"); - h_collisions_weighted->GetXaxis()->SetBinLabel(3, "JetsMCDWeighted with kTVXinEMC"); - h_collisions_weighted->GetXaxis()->SetBinLabel(4, "JetsMCPMCDMatchedWeighted with kTVXinEMC"); - h_collisions_weighted->GetXaxis()->SetBinLabel(5, "TracksWeighted with kTVXinEMC"); - h_collisions_weighted->GetXaxis()->SetBinLabel(6, "JetsMCDWeighted w/o kTVXinEMC"); - h_collisions_weighted->GetXaxis()->SetBinLabel(7, "JetsMCPMCDMatchedWeighted w/o kTVXinEMC"); - h_collisions_weighted->GetXaxis()->SetBinLabel(8, "TracksWeighted w/o kTVXinEMC"); + h_collisions_weighted->GetXaxis()->SetBinLabel(1, "total events"); + h_collisions_weighted->GetXaxis()->SetBinLabel(2, "JetsMCDWeighted with kTVXinEMC"); + h_collisions_weighted->GetXaxis()->SetBinLabel(3, "JetsMCPMCDMatchedWeighted with kTVXinEMC"); + h_collisions_weighted->GetXaxis()->SetBinLabel(4, "TracksWeighted with kTVXinEMC"); + h_collisions_weighted->GetXaxis()->SetBinLabel(5, "JetsMCDWeighted w/o kTVXinEMC"); + h_collisions_weighted->GetXaxis()->SetBinLabel(6, "JetsMCPMCDMatchedWeighted w/o kTVXinEMC"); + h_collisions_weighted->GetXaxis()->SetBinLabel(7, "TracksWeighted w/o kTVXinEMC"); + h_collisions_weighted->GetXaxis()->SetBinLabel(8, "Fake Matched Weighted MCD Jets"); + h_collisions_weighted->GetXaxis()->SetBinLabel(9, "Fake Matched Weighted MCP Jets"); } } @@ -155,7 +161,7 @@ struct FullJetSpectrapp { jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + 0.1); } - // JetTrack QA histograms + // Track QA histograms if (doprocessTracks || doprocessTracksWeighted) { registry.add("h_collisions_unweighted", "event status; event status;entries", {HistType::kTH1F, {{11, 0., 11.0}}}); @@ -182,7 +188,7 @@ struct FullJetSpectrapp { // registry.add("h_gaptrig_cluster_energy", "gap triggered cluster #varphi;#varphi_{cluster};entries", {HistType::kTH1F, {{160, 0., 7.}}}); if (doprocessTracksWeighted) { - registry.add("h_collisions_weighted", "event status;event status;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); + registry.add("h_collisions_weighted", "event status;event status;entries", {HistType::kTH1F, {{12, 0.0, 12.0}}}); registry.add("h_gaptrig_collisions", "event status; event status; entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); // registry.add("h_gaptrig_track_pt", "gap triggered track pT;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0., 350.}}}); @@ -201,9 +207,19 @@ struct FullJetSpectrapp { registry.add("h_full_jet_pt", "#it{p}_{T,jet};#it{p}_{T_jet} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0., 350.}}}); registry.add("h_full_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1., 1.}}}); registry.add("h_full_jet_phi", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, 0., 7.}}}); - registry.add("h2_full_jet_NEF", "#it{p}_{T,jet} vs NEF at Det Level; #it{p}_{T,jet} (GeV/#it{c});NEF", {HistType::kTH2F, {{350, 0., 350.}, {100, 0.0, 1.5}}}); + registry.add("h2_full_jet_NEF", "#it{p}_{T,jet} vs NEF at Det Level; #it{p}_{T,jet} (GeV/#it{c});NEF", {HistType::kTH2F, {{350, 0., 350.}, {105, 0., 1.05}}}); + registry.add("h2_full_jet_NEF_rejected", "#it{p}_{T,jet} vs NEF at Det Level for rejected events; #it{p}_{T,jet} (GeV/#it{c});NEF", {HistType::kTH2F, {{350, 0., 350.}, {105, 0., 1.05}}}); + + registry.add("h_Detjet_ntracks", "#it{p}_{T,track};#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0., 350.}}}); + registry.add("h2_full_jet_chargedconstituents", "Number of charged constituents at Det Level;#it{p}_{T,jet} (GeV/#it{c});N_{ch}", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}}); + registry.add("h2_full_jet_neutralconstituents", "Number of neutral constituents at Det Level;#it{p}_{T,jet} (GeV/#it{c});N_{ne}", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}}); + registry.add("h2_full_jettrack_pt", "#it{p}_{T,jet} vs #it{p}_{T,track}; #it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{350, 0., 350.}, {200, 0., 200.}}}); + registry.add("h2_full_jettrack_eta", "jet #eta vs jet_track #eta; #eta_{jet};#eta_{track}", {HistType::kTH2F, {{100, -1., 1.}, {500, -5., 5.}}}); + registry.add("h2_full_jettrack_phi", "jet #varphi vs jet_track #varphi; #varphi_{jet}; #varphi_{track}", {HistType::kTH2F, {{160, 0., 7.}, {160, -1., 7.}}}); + + registry.add("h2_track_etaphi", "jet_track #eta vs jet_track #varphi; #eta_{track};#varphi_{track}", {HistType::kTH2F, {{500, -5., 5.}, {160, -1., 7.}}}); + registry.add("h2_jet_etaphi", "jet #eta vs jet #varphi; #eta_{jet};#varphi_{jet}", {HistType::kTH2F, {{100, -1., 1.}, {160, -1., 7.}}}); // registry.add("h_full_mcdjet_tablesize", "", {HistType::kTH1F, {{4, 0., 5.}}}); - // registry.add("h_full_mcdjet_ntracks", "", {HistType::kTH1F, {{200, -0.5, 200.}}}); // registry.add("h_gaptrig_full_jet_pt", "gap triggered jet pT;#it{p}_{T_jet} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0., 350.}}}); // registry.add("h_gaptrig_full_jet_eta", "gap triggered jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1., 1.}}}); // registry.add("h_gaptrig_full_jet_phi", "gap triggered jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, 0., 7.}}}); @@ -216,6 +232,15 @@ struct FullJetSpectrapp { registry.add("h_full_jet_phi_part", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, 0., 7.}}}); registry.add("h2_full_jet_NEF_part", "#it{p}_{T,jet} vs NEF at Part Level;#it{p}_{T,jet} (GeV/#it{c});NEF", {HistType::kTH2F, {{350, 0., 350.}, {100, 0.0, 1.5}}}); + registry.add("h_Partjet_ntracks", "#it{p}_{T,constituent};#it{p}_{T_constituent} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0., 350.}}}); + registry.add("h2_full_jet_chargedconstituents_part", "Number of charged constituents at Part Level;#it{p}_{T,jet} (GeV/#it{c});N_{ch}", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}}); + registry.add("h2_full_jet_neutralconstituents_part", "Number of neutral constituents at Part Level;#it{p}_{T,jet} (GeV/#it{c});N_{ne}", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}}); + registry.add("h2_jettrack_pt_part", "#it{p}_{T,jet} vs #it{p}_{T_track}; #it{p}_{T_jet} (GeV/#it{c});#it{p}_{T_track} (GeV/#it{c})", {HistType::kTH2F, {{350, 0., 350.}, {200, 0., 200.}}}); + registry.add("h2_jettrack_eta_part", "jet #eta vs jet_track #eta; #eta_{jet};#eta_{track}", {HistType::kTH2F, {{100, -1., 1.}, {500, -5., 5.}}}); + registry.add("h2_jettrack_phi_part", "jet #varphi vs jet_track #varphi; #varphi_{jet}; #varphi_{track}", {HistType::kTH2F, {{160, 0., 7.}, {160, -1., 7.}}}); + + registry.add("h2_track_etaphi_part", "jet_track #eta vs jet_track #varphi; #eta_{track};#varphi_{track}", {HistType::kTH2F, {{500, -5., 5.}, {160, -1., 7.}}}); + registry.add("h2_jet_etaphi_part", "jet #eta vs jet #varphi; #eta_{jet};#varphi_{jet}", {HistType::kTH2F, {{100, -1., 1.}, {160, -1., 7.}}}); // registry.add("h_gaptrig_full_mcpjet_tablesize", "", {HistType::kTH1F, {{4, 0., 5.}}}); // registry.add("h_gaptrig_full_mcpjet_ntracks", "", {HistType::kTH1F, {{200, -0.5, 200.}}}); // registry.add("h_gaptrig_full_jet_pt_part", "jet pT;#it{p}_{T_jet} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0., 350.}}}); @@ -224,24 +249,40 @@ struct FullJetSpectrapp { } if (doprocessJetsMCPMCDMatched || doprocessJetsMCPMCDMatchedWeighted) { - registry.add("h_full_matchedmcdjet_tablesize", "", {HistType::kTH1F, {{4, 0., 5.}}}); + registry.add("h_full_matchedmcdjet_tablesize", "", {HistType::kTH1F, {{350, 0., 350.}}}); + registry.add("h_full_matchedmcpjet_tablesize", "", {HistType::kTH1F, {{350, 0., 350.}}}); registry.add("h_full_matchedmcdjet_ntracks", "", {HistType::kTH1F, {{200, -0.5, 200.}}}); - registry.add("h_full_jet_energyscaleDet", "Jet Energy Scale (det); p_{T,det} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}}); + registry.add("h_full_matchedmcpjet_ntracks", "", {HistType::kTH1F, {{200, -0.5, 200.}}}); + registry.add("h_full_matchedmcdjet_eta", "Matched MCD jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1., 1.}}}); + registry.add("h_full_matchedmcdjet_phi", "Matched MCD jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, 0., 7.}}}); + registry.add("h_full_matchedmcpjet_eta", "Matched MCP jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1., 1.}}}); + registry.add("h_full_matchedmcpjet_phi", "Matched MCP jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, 0., 7.}}}); + registry.add("h_full_jet_deltaR", "Distance between matched Det Jet and Part Jet; \\Delta R; entries", {HistType::kTH1F, {{100, 0., 1.}}}); + + registry.add("h2_full_jet_energyscaleDet", "Jet Energy Scale (det); p_{T,det} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}}); + + // registry.add("h2_matchedjettrack_eta", "jet #eta vs jet_track #eta; #eta_{jet};#eta_{track}", {HistType::kTH2F, {{100, -1., 1.}, {500, -5., 5.}}}); + // registry.add("h2_matchedjettrack_phi", "jet #varphi vs jet_track #varphi; #varphi_{jet}; #varphi_{track}", {HistType::kTH2F, {{160, 0., 7.}, {160, -1., 7.}}}); + + registry.add("h2_matchedjet_etaphiDet", "Det jet #eta vs jet #varphi; #eta_{jet};#varphi_{jet}", {HistType::kTH2F, {{100, -1., 1.}, {160, -1., 7.}}}); + registry.add("h2_matchedjet_etaphiPart", "Part jet #eta vs jet #varphi; #eta_{jet};#varphi_{jet}", {HistType::kTH2F, {{100, -1., 1.}, {160, -1., 7.}}}); // registry.add("h_full_jet_energyscaleDetCharged", "Jet Energy Scale (det, charged part); p_{t,det} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); // registry.add("h_full_jet_energyscaleDetNeutral", "Jet Energy Scale (det, neutral part); p_{t,det} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); // registry.add("h_full_jet_energyscaleDetChargedVsFull", "Jet Energy Scale (det, charged part, vs. full jet pt); p_{t,det} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); // registry.add("h_full_jet_energyscaleDetNeutralVsFull", "Jet Energy Scale (det, neutral part, vs. full jet pt); p_{t,det} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); - registry.add("h_full_jet_energyscalePart", "Jet Energy Scale (part); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}}); + registry.add("h2_full_jet_energyscalePart", "Jet Energy Scale (part); p_{T,part} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH2F, {{400, 0., 400.}, {200, -1., 1.}}}); registry.add("h3_full_jet_energyscalePart", "R dependence of Jet Energy Scale (Part); #it{R}_{jet};p_{T,det} (GeV/c); (p_{T,det} - p_{T,part})/p_{T,part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {400, 0., 400.}, {200, -1., 1.}}}); - + registry.add("h2_full_jet_etaresolutionPart", ";p_{T,part} (GeV/c); (#eta_{jet,det} - #eta_{jet,part})/#eta_{jet,part}", {HistType::kTH2F, {{400, 0., 400.}, {100, -1., 1.}}}); + registry.add("h2_full_jet_phiresolutionPart", ";p_{T,part} (GeV/c); (#varphi_{jet,det} - #varphi_{jet,part})/#varphi_{jet,part}", {HistType::kTH2F, {{400, 0., 400.}, {160, -1., 7.}}}); // registry.add("h_full_jet_energyscaleCharged", "Jet Energy Scale (charged part); p_{t,part} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); // registry.add("h_full_jet_energyscaleNeutral", "Jet Energy Scale (neutral part); p_{t,part} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); // registry.add("h_full_jet_energyscaleChargedVsFull", "Jet Energy Scale (charged part, vs. full jet pt); p_{t,part} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); // registry.add("h_full_jet_energyscaleNeutralVsFull", "Jet Energy Scale (neutral part, vs. full jet pt); p_{t,part} (GeV/c); (p_{t,det} - p_{t,part})/p_{t,part}", {HistType::kTH2F,{{400, 0., 400., 200, -1.,1.}}}); - + registry.add("h2_full_fakemcdjets", "Fake MCD Jets; p_{T,det} (GeV/c); NCounts", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}}); + registry.add("h2_full_fakemcpjets", "Fake MCP Jets; p_{T,part} (GeV/c); NCounts", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 100.}}}); // Response Matrix - registry.add("h_full_jet_ResponseMatrix", "Full Jets Response Matrix; p_{T,det} (GeV/c); p_{T,part} (GeV/c)", {HistType::kTH2F, {{400, 0., 400.}, {400, 0., 400.}}}); + registry.add("h_full_jet_ResponseMatrix", "Full Jets Response Matrix; p_{T,det} (GeV/c); p_{T,part} (GeV/c)", {HistType::kTH2F, {{200, 0., 200.}, {200, 0., 200.}}}); // registry.add("h_gaptrig_full_matchedmcdjet_tablesize", "", {HistType::kTH1F, {{4, 0., 5.}}}); // registry.add("h_gaptrig_full_matchedmcdjet_ntracks", "", {HistType::kTH1F, {{200, -0.5, 200.}}}); @@ -303,26 +344,55 @@ struct FullJetSpectrapp { void fillJetHistograms(T const& jet, float weight = 1.0) { float neutralEnergy = 0.0; + // std::cout << "jet r is " << jet.r() << " its rounded value is " << round(selectedJetsRadius * 100.0f) << std::endl; if (jet.r() == round(selectedJetsRadius * 100.0f)) { registry.fill(HIST("h_full_jet_pt"), jet.pt(), weight); registry.fill(HIST("h_full_jet_eta"), jet.eta(), weight); registry.fill(HIST("h_full_jet_phi"), jet.phi(), weight); // registry.fill(HIST("h_full_mcdjet_tablesize"), jet.size(), weight); // registry.fill(HIST("h_full_mcdjet_ntracks"), jet.tracksIds().size(), weight); - // registry.fill(HIST("h_full_jet_energyscaleDet"), jet.phi(), weight); // } + registry.fill(HIST("h2_jet_etaphi"), jet.eta(), jet.phi(), weight); + for (auto& cluster : jet.template clusters_as()) { + registry.fill(HIST("h2_full_jet_neutralconstituents"), jet.pt(), jet.clustersIds().size(), weight); neutralEnergy += cluster.energy(); } auto NEF = neutralEnergy / jet.energy(); registry.fill(HIST("h2_full_jet_NEF"), jet.pt(), NEF, weight); - } + + for (auto& jettrack : jet.template tracks_as()) { + registry.fill(HIST("h_Detjet_ntracks"), jettrack.pt(), weight); + registry.fill(HIST("h2_full_jet_chargedconstituents"), jet.pt(), jet.tracksIds().size(), weight); + registry.fill(HIST("h2_full_jettrack_pt"), jet.pt(), jettrack.pt(), weight); + registry.fill(HIST("h2_full_jettrack_eta"), jet.eta(), jettrack.eta(), weight); + registry.fill(HIST("h2_full_jettrack_phi"), jet.phi(), jettrack.phi(), weight); + + registry.fill(HIST("h2_track_etaphi"), jettrack.eta(), jettrack.phi(), weight); + } + } // jet.r() + } + + // check for NEF distribution for rejected events + template + void fillRejectedJetHistograms(T const& jet, float weight = 1.0) + { + float neutralEnergy = 0.0; + if (jet.r() == round(selectedJetsRadius * 100.0f)) { + for (auto& cluster : jet.template clusters_as()) { + neutralEnergy += cluster.energy(); + } + auto NEF = neutralEnergy / jet.energy(); + registry.fill(HIST("h2_full_jet_NEF_rejected"), jet.pt(), NEF, weight); + } // jet.r() } template void fillMCPHistograms(T const& jet, float weight = 1.0) { float neutralEnergy = 0.0; + int neutralconsts = 0; + int chargedconsts = 0; if (jet.r() == round(selectedJetsRadius * 100.0f)) { registry.fill(HIST("h_full_mcpjet_tablesize"), jet.size(), weight); registry.fill(HIST("h_full_mcpjet_ntracks"), jet.tracksIds().size(), weight); @@ -331,13 +401,23 @@ struct FullJetSpectrapp { registry.fill(HIST("h_full_jet_phi_part"), jet.phi(), weight); // registry.fill(HIST("h_full_jet_ntracks_part"), jet.tracksIds().size(), weight); // } + registry.fill(HIST("h2_jet_etaphi_part"), jet.eta(), jet.phi(), weight); + for (auto& constituent : jet.template tracks_as()) { auto pdgParticle = pdgDatabase->GetParticle(constituent.pdgCode()); if (pdgParticle->Charge() == 0) { - neutralEnergy += constituent.e(); + neutralconsts++; + neutralEnergy += constituent.e(); // neutral jet constituents at particle level + registry.fill(HIST("h2_full_jet_neutralconstituents_part"), jet.pt(), neutralconsts, weight); + } else { + chargedconsts++; + registry.fill(HIST("h2_full_jet_chargedconstituents_part"), jet.pt(), chargedconsts, weight); // charged jet constituents at particle level + registry.fill(HIST("h2_jettrack_pt_part"), jet.pt(), constituent.pt(), weight); + registry.fill(HIST("h2_jettrack_eta_part"), jet.eta(), constituent.eta(), weight); + registry.fill(HIST("h2_jettrack_phi_part"), jet.phi(), constituent.phi(), weight); + registry.fill(HIST("h2_track_etaphi_part"), constituent.eta(), constituent.phi(), weight); } - // To Do: Fill particle level track histos - } + } // constituent loop auto NEF = neutralEnergy / jet.energy(); registry.fill(HIST("h2_full_jet_NEF_part"), jet.pt(), NEF, weight); } @@ -373,30 +453,63 @@ struct FullJetSpectrapp { template void fillMatchedHistograms(T const& jetBase, float weight = 1.0) { + if (doJJMC) { - float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); - if (jetBase.pt() > pTHatMaxMCD * pTHat) { // Here, jetBase = mcd jets and jetTag = mcp jets - return; - } - - if (jetBase.has_matchedJetGeo()) { // geometrical jet matching only needed for pp - for (auto& jetTag : jetBase.template matchedJetGeo_as>()) { - if (jetTag.pt() > pTHatMaxMCP * pTHat) { - continue; - } - // std::cout << jetTag.pt() << endl; + if (jetBase.has_matchedJetGeo()) { // geometrical jet matching only needed for pp - here,matching Base(Det.level) with Tag (Part. level) jets registry.fill(HIST("h_full_matchedmcdjet_tablesize"), jetBase.size(), weight); registry.fill(HIST("h_full_matchedmcdjet_ntracks"), jetBase.tracksIds().size(), weight); - registry.fill(HIST("h_full_jet_energyscaleDet"), jetBase.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); - registry.fill(HIST("h_full_jet_energyscalePart"), jetTag.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); - - // JES for different jet R values - registry.fill(HIST("h3_full_jet_energyscalePart"), jetBase.r() / 100.0, jetTag.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); - - // Response Matrix - registry.fill(HIST("h_full_jet_ResponseMatrix"), jetBase.pt(), jetTag.pt(), weight); // MCD vs MCP jet pT - } - } + registry.fill(HIST("h2_matchedjet_etaphiDet"), jetBase.eta(), jetBase.phi(), weight); + + for (auto& jetTag : jetBase.template matchedJetGeo_as>()) { + + auto deltaEta = jetBase.eta() - jetTag.eta(); + auto deltaPhi = jetBase.phi() - jetTag.phi(); + auto deltaR = jetutilities::deltaR(jetBase, jetTag); + + registry.fill(HIST("h_full_jet_deltaR"), deltaR, weight); + registry.fill(HIST("h_full_matchedmcpjet_tablesize"), jetTag.size(), weight); + registry.fill(HIST("h_full_matchedmcpjet_ntracks"), jetTag.tracksIds().size(), weight); + registry.fill(HIST("h2_matchedjet_etaphiPart"), jetTag.eta(), jetTag.phi(), weight); + // JES + registry.fill(HIST("h2_full_jet_energyscaleDet"), jetBase.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); + registry.fill(HIST("h2_full_jet_energyscalePart"), jetTag.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); + registry.fill(HIST("h3_full_jet_energyscalePart"), jetBase.r() / 100.0, jetTag.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); + registry.fill(HIST("h2_full_jet_etaresolutionPart"), jetTag.pt(), deltaEta / jetTag.eta(), weight); + registry.fill(HIST("h2_full_jet_phiresolutionPart"), jetTag.pt(), deltaPhi / jetTag.phi(), weight); + + // Response Matrix + registry.fill(HIST("h_full_jet_ResponseMatrix"), jetBase.pt(), jetTag.pt(), weight); // MCD vs MCP jet pT + } // jetTag + } // jetBase + } else { + if (jetBase.has_matchedJetGeo()) { // geometrical jet matching only needed for pp - here,matching Base(Det.level) with Tag (Part. level) jets + registry.fill(HIST("h_full_matchedmcdjet_tablesize"), jetBase.size(), weight); + registry.fill(HIST("h_full_matchedmcdjet_ntracks"), jetBase.tracksIds().size(), weight); + registry.fill(HIST("h2_matchedjet_etaphiDet"), jetBase.eta(), jetBase.phi(), weight); + + for (auto& jetTag : jetBase.template matchedJetGeo_as>()) { + + auto deltaEta = jetBase.eta() - jetTag.eta(); + auto deltaPhi = jetBase.phi() - jetTag.phi(); + auto deltaR = jetutilities::deltaR(jetBase, jetTag); + + registry.fill(HIST("h_full_jet_deltaR"), deltaR, weight); + registry.fill(HIST("h_full_matchedmcpjet_tablesize"), jetTag.size(), weight); + registry.fill(HIST("h_full_matchedmcpjet_ntracks"), jetTag.tracksIds().size(), weight); + + registry.fill(HIST("h2_matchedjet_etaphiPart"), jetTag.eta(), jetTag.phi(), weight); + // JES + registry.fill(HIST("h2_full_jet_energyscaleDet"), jetBase.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); + registry.fill(HIST("h2_full_jet_energyscalePart"), jetTag.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); + registry.fill(HIST("h3_full_jet_energyscalePart"), jetBase.r() / 100.0, jetTag.pt(), (jetBase.pt() - jetTag.pt()) / jetTag.pt(), weight); + registry.fill(HIST("h2_full_jet_etaresolutionPart"), jetTag.pt(), deltaEta / jetTag.eta(), weight); + registry.fill(HIST("h2_full_jet_phiresolutionPart"), jetTag.pt(), deltaPhi / jetTag.phi(), weight); + + // Response Matrix + registry.fill(HIST("h_full_jet_ResponseMatrix"), jetBase.pt(), jetTag.pt(), weight); // MCD vs MCP jet pT + } // jetTag + } // jetBase + } // else } void processDummy(JetCollisions const&) @@ -406,25 +519,30 @@ struct FullJetSpectrapp { void processJetsData(soa::Filtered::iterator const& collision, FullJetTableDataJoined const& jets, JetTracks const&, JetClusters const&) { - registry.fill(HIST("h_collisions_unweighted"), 1.0); + registry.fill(HIST("h_collisions_unweighted"), 1.0); // total events bool eventAccepted = false; if (doEMCALEventWorkaround) { if (collision.isEmcalReadout() && !collision.isAmbiguous()) { // i.e. EMCAL has a cell content eventAccepted = true; if (collision.alias_bit(kTVXinEMC)) { - registry.fill(HIST("h_collisions_unweighted"), 2.0); + registry.fill(HIST("h_collisions_unweighted"), 2.0); // JetsData with kTVXinEMC } } } else { if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) { eventAccepted = true; - registry.fill(HIST("h_collisions_unweighted"), 2.0); + registry.fill(HIST("h_collisions_unweighted"), 2.0); // JetsData with kTVXinEMC } } if (!eventAccepted) { - registry.fill(HIST("h_collisions_unweighted"), 6.0); + registry.fill(HIST("h_collisions_unweighted"), 6.0); // JetsData w/o kTVXinEMC + for (auto const& jet : jets) { + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || !isAcceptedJet(jet)) { + fillRejectedJetHistograms(jet, 1.0); + } + } return; } @@ -432,6 +550,9 @@ struct FullJetSpectrapp { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (jet.phi() < jetPhiMin || jet.phi() > jetPhiMax) { + continue; + } if (!isAcceptedJet(jet)) { continue; } @@ -442,25 +563,30 @@ struct FullJetSpectrapp { void processJetsMCD(soa::Filtered::iterator const& collision, JetTableMCDJoined const& jets, JetTracks const&, JetClusters const&) { - registry.fill(HIST("h_collisions_unweighted"), 1.0); + registry.fill(HIST("h_collisions_unweighted"), 1.0); // total events bool eventAccepted = false; if (doEMCALEventWorkaround) { if (collision.isEmcalReadout() && !collision.isAmbiguous()) { // i.e. EMCAL has a cell content eventAccepted = true; if (collision.alias_bit(kTVXinEMC)) { - registry.fill(HIST("h_collisions_unweighted"), 3.0); + registry.fill(HIST("h_collisions_unweighted"), 3.0); // JetsMCD with kTVXinEMC } } } else { if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) { eventAccepted = true; - registry.fill(HIST("h_collisions_unweighted"), 3.0); + registry.fill(HIST("h_collisions_unweighted"), 3.0); // JetsMCD with kTVXinEMC } } if (!eventAccepted) { - registry.fill(HIST("h_collisions_unweighted"), 7.0); + registry.fill(HIST("h_collisions_unweighted"), 7.0); // JetsMCD w/o kTVXinEMC + for (auto const& jet : jets) { + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || !isAcceptedJet(jet)) { + fillRejectedJetHistograms(jet, 1.0); + } + } return; } @@ -468,6 +594,9 @@ struct FullJetSpectrapp { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (jet.phi() < jetPhiMin || jet.phi() > jetPhiMax) { + continue; + } if (!isAcceptedJet(jet)) { continue; } @@ -478,25 +607,30 @@ struct FullJetSpectrapp { void processJetsMCDWeighted(soa::Filtered::iterator const& collision, JetTableMCDWeightedJoined const& jets, JetTracks const&, JetClusters const&) { - registry.fill(HIST("h_collisions_weighted"), 1.0); + registry.fill(HIST("h_collisions_weighted"), 1.0); // total events bool eventAccepted = false; if (doEMCALEventWorkaround) { if (collision.isEmcalReadout() && !collision.isAmbiguous()) { // i.e. EMCAL has a cell content eventAccepted = true; if (collision.alias_bit(kTVXinEMC)) { - registry.fill(HIST("h_collisions_weighted"), 2.0); + registry.fill(HIST("h_collisions_weighted"), 2.0); // JetsMCDWeighted with kTVXinEMC } } } else { if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) { eventAccepted = true; - registry.fill(HIST("h_collisions_weighted"), 2.0); + registry.fill(HIST("h_collisions_weighted"), 2.0); // JetsMCDWeighted with kTVXinEMC } } if (!eventAccepted) { - registry.fill(HIST("h_collisions_weighted"), 5.0); + registry.fill(HIST("h_collisions_weighted"), 5.0); // JetsMCDWeighted w/o kTVXinEMC + for (auto const& jet : jets) { + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || !isAcceptedJet(jet)) { + fillRejectedJetHistograms(jet, 1.0); + } + } return; } @@ -504,10 +638,16 @@ struct FullJetSpectrapp { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } + if (jet.phi() < jetPhiMin || jet.phi() > jetPhiMax) { + continue; + } if (!isAcceptedJet(jet)) { continue; } + // std::cout << "jet pT" << jet.pt() << "jet eta"<< jet.eta()<< "jet phi"<< jet.phi()<< std::endl; + // std::cout << "Event weight: " << jet.eventWeight() << std::endl; fillJetHistograms(jet, jet.eventWeight()); + // std::cout << "jet pT" << jet.pt() << "jet eta"<< jet.eta()<< "jet phi"<< jet.phi()<< std::endl; } } PROCESS_SWITCH(FullJetSpectrapp, processJetsMCDWeighted, "Full Jets at Detector Level on weighted events", false); @@ -532,13 +672,15 @@ struct FullJetSpectrapp { if (!isAcceptedJet(jet)) { return; } + // std::cout << "jet pT" << jet.pt() << "jet eta"<< jet.eta()<< "jet phi"<< jet.phi()<< std::endl; + // std::cout << "Event weight: " << jet.eventWeight() << std::endl; fillMCPHistograms(jet, jet.eventWeight()); } PROCESS_SWITCH(FullJetSpectrapp, processJetsMCPWeighted, "Full Jets at Particle Level on weighted events", false); void processTracks(soa::Filtered::iterator const& collision, soa::Filtered const& tracks, soa::Filtered const& clusters) { - registry.fill(HIST("h_collisions_unweighted"), 1.0); + registry.fill(HIST("h_collisions_unweighted"), 1.0); // total events bool eventAccepted = false; // needed for the workaround to access EMCAL trigger bits. - This is needed for the MC productions in which the EMC trigger bits are missing. (MB MC LHC24f3, for ex.) // It first requires for atleast a cell in EMCAL to have energy content. @@ -551,7 +693,7 @@ struct FullJetSpectrapp { if (collision.isEmcalReadout() && !collision.isAmbiguous()) { // i.e. EMCAL has a cell content eventAccepted = true; if (collision.alias_bit(kTVXinEMC)) { - registry.fill(HIST("h_collisions_unweighted"), 4.0); + registry.fill(HIST("h_collisions_unweighted"), 4.0); // Tracks with kTVXinEMC } } } else { @@ -559,12 +701,12 @@ struct FullJetSpectrapp { // This is the default check for the simulations with proper trigger flags not requiring the above workaround. if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) { eventAccepted = true; - registry.fill(HIST("h_collisions_unweighted"), 4.0); + registry.fill(HIST("h_collisions_unweighted"), 4.0); // Tracks with kTVXinEMC } } if (!eventAccepted) { - registry.fill(HIST("h_collisions_unweighted"), 8.0); + registry.fill(HIST("h_collisions_unweighted"), 8.0); // Tracks w/o kTVXinEMC return; } // Fill Accepted events histos @@ -572,29 +714,36 @@ struct FullJetSpectrapp { } PROCESS_SWITCH(FullJetSpectrapp, processTracks, "Full Jet tracks", false); - void processJetsMCPMCDMatched(soa::Filtered::iterator const& collision, JetTableMCDMatchedJoined const& mcdjets, JetTableMCPMatchedJoined const&, JetTracks const&, JetClusters const&, JetParticles const&) + void processJetsMCPMCDMatched(soa::Filtered>::iterator const& collision, JetTableMCDMatchedJoined const& mcdjets, JetTableMCPMatchedJoined const&, aod::JMcCollisions const&, JetTracks const&, JetClusters const&, JetParticles const&) { - registry.fill(HIST("h_collisions_unweighted"), 1.0); + registry.fill(HIST("h_collisions_unweighted"), 1.0); // total events bool eventAccepted = false; + if (fabs(collision.posZ()) > VertexZCut) { // making double sure this condition is satisfied + return; + } + if (!collision.has_mcCollision()) { + return; + } + //**start of event selection** if (doEMCALEventWorkaround) { if (collision.isEmcalReadout() && !collision.isAmbiguous()) { // i.e. EMCAL has a cell content eventAccepted = true; if (collision.alias_bit(kTVXinEMC)) { - registry.fill(HIST("h_collisions_unweighted"), 5.0); + registry.fill(HIST("h_collisions_unweighted"), 5.0); // JetsMCPMCDMatched with kTVXinEMC } } } else { if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) { eventAccepted = true; - registry.fill(HIST("h_collisions_unweighted"), 5.0); + registry.fill(HIST("h_collisions_unweighted"), 5.0); // JetsMCPMCDMatched with kTVXinEMC } } - if (!eventAccepted) { - registry.fill(HIST("h_collisions_unweighted"), 9.0); + registry.fill(HIST("h_collisions_unweighted"), 9.0); // JetsMCPMCDMatched w/o kTVXinEMC return; } + //**end of event selection** for (const auto& mcdjet : mcdjets) { if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -603,44 +752,102 @@ struct FullJetSpectrapp { if (!isAcceptedJet(mcdjet)) { continue; } - fillMatchedHistograms(mcdjet); - } + if (mcdjet.phi() < jetPhiMin || mcdjet.phi() > jetPhiMax) { + continue; + } + if (!mcdjet.has_matchedJetGeo()) { + continue; + } + for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { + + if (!mcpjet.has_matchedJetGeo()) { + continue; + } + // apply emcal fiducial cuts to the matched particle level jets + if (mcpjet.eta() > jetEtaMax || mcpjet.phi() > jetPhiMax || !jetfindingutilities::isInEtaAcceptance(mcpjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + registry.fill(HIST("h_full_matchedmcpjet_eta"), mcpjet.eta(), 1.0); + registry.fill(HIST("h_full_matchedmcpjet_phi"), mcpjet.phi(), 1.0); + fillMatchedHistograms(mcdjet); + } // mcpjet loop + registry.fill(HIST("h_full_matchedmcdjet_eta"), mcdjet.eta(), 1.0); + registry.fill(HIST("h_full_matchedmcdjet_phi"), mcdjet.phi(), 1.0); + } // mcdjet loop } PROCESS_SWITCH(FullJetSpectrapp, processJetsMCPMCDMatched, "Full Jet finder MCP matched to MCD", false); - void processJetsMCPMCDMatchedWeighted(soa::Filtered::iterator const& collision, JetTableMCDMatchedWeightedJoined const& mcdjets, JetTableMCPMatchedWeightedJoined const&, JetTracks const&, JetClusters const&, JetParticles const&) + void processJetsMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, JetTableMCDMatchedWeightedJoined const& mcdjets, JetTableMCPMatchedWeightedJoined const&, aod::JMcCollisions const&, JetTracks const&, JetClusters const&, JetParticles const&) { - registry.fill(HIST("h_collisions_weighted"), 1.0); + float eventWeight = collision.mcCollision().weight(); + registry.fill(HIST("h_collisions_weighted"), 1.0, eventWeight); // total events bool eventAccepted = false; + int fakemcdjet = 0; + int fakemcpjet = 0; + float weight = 1.0; + float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); if (doEMCALEventWorkaround) { if (collision.isEmcalReadout() && !collision.isAmbiguous()) { // i.e. EMCAL has a cell content eventAccepted = true; if (collision.alias_bit(kTVXinEMC)) { - registry.fill(HIST("h_collisions_weighted"), 3.0); + registry.fill(HIST("h_collisions_weighted"), 3.0, eventWeight); // JetsMCPMCDMatchedWeighted with kTVXinEMC } } } else { if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) { eventAccepted = true; - registry.fill(HIST("h_collisions_weighted"), 3.0); + registry.fill(HIST("h_collisions_weighted"), 3.0, eventWeight); // JetsMCPMCDMatchedWeighted with kTVXinEMC } } if (!eventAccepted) { - registry.fill(HIST("h_collisions_weighted"), 6.0); + registry.fill(HIST("h_collisions_weighted"), 6.0, eventWeight); // JetsMCPMCDMatchedWeighted w/o kTVXinEMC return; } for (const auto& mcdjet : mcdjets) { + if (mcdjet.pt() > pTHatMaxMCD * pTHat) { + eventAccepted = false; ////reject the whole event for outlier jets + fakemcdjet++; + registry.fill(HIST("h_collisions_weighted"), 8.0); // Fake Matched Weighted MCD Jets + registry.fill(HIST("h2_full_fakemcdjets"), mcdjet.pt(), fakemcdjet, eventWeight); + break; + } if (!jetfindingutilities::isInEtaAcceptance(mcdjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; } if (!isAcceptedJet(mcdjet)) { continue; } - fillMatchedHistograms(mcdjet, mcdjet.eventWeight()); - } + if (mcdjet.phi() < jetPhiMin || mcdjet.phi() > jetPhiMax) { + continue; + } + if (!mcdjet.has_matchedJetGeo()) { + continue; + } + for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { + if (mcpjet.pt() > pTHatMaxMCP * pTHat) { + eventAccepted = false; // reject the whole event for outlier jets + fakemcpjet++; + registry.fill(HIST("h_collisions_weighted"), 9.0); // Fake Matched Weighted MCP Jets + registry.fill(HIST("h2_full_fakemcpjets"), mcpjet.pt(), fakemcpjet, eventWeight); + break; + } + if (!mcpjet.has_matchedJetGeo()) { + continue; + } + // apply emcal fiducial cuts to the matched particle level jets + if (mcpjet.eta() > jetEtaMax || mcpjet.phi() > jetPhiMax || !jetfindingutilities::isInEtaAcceptance(mcpjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + registry.fill(HIST("h_full_matchedmcpjet_eta"), mcpjet.eta(), eventWeight); + registry.fill(HIST("h_full_matchedmcpjet_phi"), mcpjet.phi(), eventWeight); + fillMatchedHistograms(mcdjet, mcdjet.eventWeight()); + } // mcpjet + registry.fill(HIST("h_full_matchedmcdjet_eta"), mcdjet.eta(), eventWeight); + registry.fill(HIST("h_full_matchedmcdjet_phi"), mcdjet.phi(), eventWeight); + } // mcdjet } PROCESS_SWITCH(FullJetSpectrapp, processJetsMCPMCDMatchedWeighted, "Full Jet finder MCP matched to MCD on weighted events", false); @@ -651,7 +858,7 @@ struct FullJetSpectrapp { { bool eventAccepted = false; float eventWeight = collision.mcCollision().weight(); - registry.fill(HIST("h_collisions_weighted"), 1.0, eventWeight); + registry.fill(HIST("h_collisions_weighted"), 1.0, eventWeight); // total events // set "doMBGapTrigger" to true only if you are testing with MB Gap-triggers if (doMBGapTrigger && eventWeight == 1) { @@ -663,7 +870,7 @@ struct FullJetSpectrapp { eventAccepted = true; fillTrackHistograms(tracks, clusters, eventWeight); if (collision.alias_bit(kTVXinEMC)) { - registry.fill(HIST("h_collisions_weighted"), 4.0, eventWeight); + registry.fill(HIST("h_collisions_weighted"), 4.0, eventWeight); // TracksWeighted with kTVXinEMC } } } else { @@ -671,12 +878,12 @@ struct FullJetSpectrapp { // This is the default check for the simulations with proper trigger flags not requiring the above workaround. if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) { eventAccepted = true; - registry.fill(HIST("h_collisions_weighted"), 4.0, eventWeight); + registry.fill(HIST("h_collisions_weighted"), 4.0, eventWeight); // TracksWeighted with kTVXinEMC } } if (!eventAccepted) { - registry.fill(HIST("h_collisions_weighted"), 7.0, eventWeight); + registry.fill(HIST("h_collisions_weighted"), 7.0, eventWeight); // TracksWeighted w/o kTVXinEMC return; } // registry.fill(HIST("h_gaptrig_collisions"), 1.0, eventWeight); From 350368c919c6c018d4352ae9e7714b77f0f8d030 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Tue, 3 Sep 2024 15:35:30 +0200 Subject: [PATCH 04/60] PWGHF: Add XicToPKPi to taskMcEfficiency.cxx (#7524) * PWGHF: Add XicToPKPi to efficiency task * Please consider the following formatting changes * Update taskMcEfficiency.cxx * Please consider the following formatting changes --------- Co-authored-by: Himanshu Sharma Co-authored-by: ALICE Action Bot --- PWGHF/Tasks/taskMcEfficiency.cxx | 90 +++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 18 deletions(-) diff --git a/PWGHF/Tasks/taskMcEfficiency.cxx b/PWGHF/Tasks/taskMcEfficiency.cxx index 024632dd7a1..abdbfcd2d59 100644 --- a/PWGHF/Tasks/taskMcEfficiency.cxx +++ b/PWGHF/Tasks/taskMcEfficiency.cxx @@ -39,7 +39,7 @@ struct HfTaskMcEfficiency { ConfigurableAxis axisPt{"axisPt", {10, 0, 10}, "pT axis"}; ConfigurableAxis axisMass{"axisMass", {120, 1.5848, 2.1848}, "m_inv axis"}; - ConfigurableAxis axisPdg{"axisPdg", {VARIABLE_WIDTH, -4122.5, -431.5, -421.5, -411.5, 0, 411.5, 421.5, 431.5, 4122.5}, "PDG code axis"}; + ConfigurableAxis axisPdg{"axisPdg", {VARIABLE_WIDTH, -4232.5, -4122.5, -431.5, -421.5, -411.5, 0, 411.5, 421.5, 431.5, 4122.5, 4232.5}, "PDG code axis"}; ConfigurableAxis axisCPA{"axisCPA", {102, -1.02, 1.02}, "Cosine of pointing angle axis"}; Configurable mcAcceptancePt{"mcAcceptancePt", 0.1, "MC Acceptance: lower pt limit"}; @@ -101,7 +101,7 @@ struct HfTaskMcEfficiency { return track.isGlobalTrackWoDCA(); } - template + template void candidate3ProngLoop(T1& candidates, T2& tracks, T3& mcParticles, std::vector pdgCodes) { using TracksType = std::decay_t; @@ -130,6 +130,11 @@ struct HfTaskMcEfficiency { pdgDaughters[0] = +kProton; pdgDaughters[1] = -kKPlus; pdgDaughters[2] = +kPiPlus; + } else if (pdgCode == Pdg::kXiCPlus) { + decayType = 1 << aod::hf_cand_3prong::DecayType::XicToPKPi; + pdgDaughters[0] = +kProton; + pdgDaughters[1] = -kKPlus; + pdgDaughters[2] = +kPiPlus; } else { LOGP(fatal, "Not implemented for PDG {}", pdgCode); } @@ -164,6 +169,12 @@ struct HfTaskMcEfficiency { isHypoMass2SelStep = candidate.isSelLcToPiKP(); } } + if constexpr (hasXicPlus) { + if (pdgCode == Pdg::kXiCPlus) { + isHypoMass1SelStep = candidate.isSelXicToPKPi(); + isHypoMass2SelStep = candidate.isSelXicToPiKP(); + } + } bool collisionMatched = false; int origin = RecoDecay::OriginType::None; @@ -194,6 +205,23 @@ struct HfTaskMcEfficiency { } } + if (pdgCode == Pdg::kXiCPlus) { + auto daughter = trackPos.mcParticle(); + if (std::abs(daughter.pdgCode()) == kProton) { + isHypoMass1TrackStep = true; + isHypoMass1SelStep = true; + isHypoMass2TrackStep = false; + isHypoMass2SelStep = false; + } else if (std::abs(daughter.pdgCode()) == kPiPlus) { + isHypoMass1TrackStep = false; + isHypoMass1SelStep = false; + isHypoMass2TrackStep = true; + isHypoMass2SelStep = true; + } else { + continue; + } + } + collisionMatched = candidate.template collision_as().mcCollisionId() == mcParticles.iteratorAt(indexRec).mcCollisionId(); } /// end info MC used @@ -207,6 +235,8 @@ struct HfTaskMcEfficiency { if (isHypoMass1TrackStep) { if (pdgCode == Pdg::kLambdaCPlus) { massHypo1 = hfHelper.invMassLcToPKPi(candidate); + } else if (pdgCode == Pdg::kXiCPlus) { + massHypo1 = hfHelper.invMassXicToPKPi(candidate); } else if (pdgCode == Pdg::kDPlus) { massHypo1 = hfHelper.invMassDplusToPiKPi(candidate); } else if (pdgCode == Pdg::kDS) { @@ -217,6 +247,8 @@ struct HfTaskMcEfficiency { if (isHypoMass2TrackStep) { if (pdgCode == Pdg::kLambdaCPlus) { massHypo2 = hfHelper.invMassLcToPiKP(candidate); + } else if (pdgCode == Pdg::kXiCPlus) { + massHypo2 = hfHelper.invMassXicToPiKP(candidate); } else if (pdgCode == Pdg::kDS) { massHypo2 = hfHelper.invMassDsToPiKK(candidate); } @@ -481,10 +513,10 @@ struct HfTaskMcEfficiency { /// 3-prong analyses - template + template void candidate3ProngMcLoop(C const& candidates, TracksWithSelectionMC const& tracks, aod::McParticles const& mcParticles, aod::McCollisionLabels const&, std::vector pdgCodes) { - candidate3ProngLoop(candidates, tracks, mcParticles, pdgCodes); + candidate3ProngLoop(candidates, tracks, mcParticles, pdgCodes); auto hCandidates = registry.get(HIST("hCandidates")); auto hTrackablePtEta = registry.get(HIST("hTrackablePtEta")); @@ -535,6 +567,10 @@ struct HfTaskMcEfficiency { pdgDaughters[0] = +kProton; pdgDaughters[1] = -kKPlus; pdgDaughters[2] = +kPiPlus; + } else if (pdgCode == Pdg::kXiCPlus) { + pdgDaughters[0] = +kProton; + pdgDaughters[1] = -kKPlus; + pdgDaughters[2] = +kPiPlus; } else { LOGP(fatal, "Not implemented for PDG {}", pdgCode); } @@ -661,7 +697,7 @@ struct HfTaskMcEfficiency { TracksWithSelection const& tracks) { std::vector pdgCodes{Pdg::kDPlus}; - candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplus, "Process D+ data (no MC information needed)", false); @@ -669,7 +705,7 @@ struct HfTaskMcEfficiency { TracksWithSelection const& tracks) { std::vector pdgCodes{Pdg::kDS}; - candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDs, "Process Ds+ data (no MC information needed)", false); @@ -677,15 +713,23 @@ struct HfTaskMcEfficiency { TracksWithSelection const& tracks) { std::vector pdgCodes{Pdg::kLambdaCPlus}; - candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataLc, "Process Lc data (no MC information needed)", false); + void processDataXic(soa::Join const& candidates, + TracksWithSelection const& tracks) + { + std::vector pdgCodes{Pdg::kXiCPlus}; + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + } + PROCESS_SWITCH(HfTaskMcEfficiency, processDataXic, "Process Xic data (no MC information needed)", false); + void processDataDplusDs(soa::Join const& candidates, TracksWithSelection const& tracks) { std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS}; - candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusDs, "Process D+ and Ds+ data (no MC information needed)", false); @@ -693,7 +737,7 @@ struct HfTaskMcEfficiency { TracksWithSelection const& tracks) { std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; - candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusDsLc, "Process D+, Ds+, and Lc data (no MC information needed)", false); @@ -701,7 +745,7 @@ struct HfTaskMcEfficiency { TracksWithSelection const& tracks) { std::vector pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; - candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusLc, "Process D+ and Lc data (no MC information needed)", false); @@ -709,7 +753,7 @@ struct HfTaskMcEfficiency { TracksWithSelection const& tracks) { std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; - candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); + candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDsLc, "Process Ds+ and Lc data (no MC information needed)", false); @@ -730,7 +774,7 @@ struct HfTaskMcEfficiency { aod::McCollisionLabels const& colls) { std::vector pdgCodes{Pdg::kDPlus}; - candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplus, "Process MC for D+ signal", false); @@ -740,7 +784,7 @@ struct HfTaskMcEfficiency { aod::McCollisionLabels const& colls) { std::vector pdgCodes{Pdg::kDS}; - candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDs, "Process MC for Ds+ signal", false); @@ -750,17 +794,27 @@ struct HfTaskMcEfficiency { aod::McCollisionLabels const& colls) { std::vector pdgCodes{Pdg::kLambdaCPlus}; - candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcLc, "Process MC for Lc signal", false); + void processMcXic(soa::Join const& candidates, + TracksWithSelectionMC const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisionLabels const& colls) + { + std::vector pdgCodes{Pdg::kXiCPlus}; + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + } + PROCESS_SWITCH(HfTaskMcEfficiency, processMcXic, "Process MC for Xic signal", false); + void processMcDplusDs(soa::Join const& candidates, TracksWithSelectionMC const& tracks, aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS}; - candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusDs, "Process MC for D+ and Ds+ signals", false); @@ -770,7 +824,7 @@ struct HfTaskMcEfficiency { aod::McCollisionLabels const& colls) { std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; - candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusDsLc, "Process MC for D+, Ds+, and Lc signals", false); @@ -780,7 +834,7 @@ struct HfTaskMcEfficiency { aod::McCollisionLabels const& colls) { std::vector pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; - candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusLc, "Process MC for D+ and Lc signals", false); @@ -790,7 +844,7 @@ struct HfTaskMcEfficiency { aod::McCollisionLabels const& colls) { std::vector pdgCodes{Pdg::kDS, Pdg::kLambdaCPlus}; - candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); + candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDsLc, "Process MC for Ds+ and Lc signals", false); }; From 68cf2e82a39f2a4ce24d3c7a65a305f89968798a Mon Sep 17 00:00:00 2001 From: Francesca Ercolessi Date: Tue, 3 Sep 2024 17:27:46 +0200 Subject: [PATCH 05/60] adjust rejection of protons (#7548) --- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 711866c9a2c..47b9a5eb886 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -610,13 +610,11 @@ struct hadronnucleicorrelation { isAntiPr = true; } } - if (TMath::Abs(track.tpcNSigmaDe()) < nsigmaTPC && TMath::Abs(track.tpcNSigmaPr()) >= nsigmaTPC) { - if (TMath::Abs(track.tofNSigmaDe()) < nsigmaTOF && TMath::Abs(track.tofNSigmaPr()) >= nsigmaTOF) { - if (track.sign() > 0) { - isDeTPCTOF = true; - } else if (track.sign() < 0) { - isAntiDeTPCTOF = true; - } + if (TMath::Abs(track.tpcNSigmaDe()) < nsigmaTPC && TMath::Abs(track.tofNSigmaDe()) < nsigmaTOF && TMath::Abs(track.tofNSigmaPr()) >= nsigmaTOF) { + if (track.sign() > 0) { + isDeTPCTOF = true; + } else if (track.sign() < 0) { + isAntiDeTPCTOF = true; } } @@ -936,10 +934,8 @@ struct hadronnucleicorrelation { registry.fill(HIST("hResEta_Deuteron"), track.eta_MC(), track.eta() - track.eta_MC()); registry.fill(HIST("hResPhi_Deuteron"), track.phi_MC(), track.phi() - track.phi_MC()); - if (TMath::Abs(track.tpcNSigmaDe()) < nsigmaTPC && TMath::Abs(track.tpcNSigmaPr()) >= nsigmaTPC) { - if (TMath::Abs(track.tofNSigmaDe()) < nsigmaTOF && TMath::Abs(track.tofNSigmaPr()) >= nsigmaTOF) { - registry.fill(HIST("hReco_PID_EtaPhiPt_Deuteron"), track.eta(), track.phi(), track.pt()); - } + if (TMath::Abs(track.tpcNSigmaDe()) < nsigmaTPC && TMath::Abs(track.tofNSigmaDe()) < nsigmaTOF && TMath::Abs(track.tofNSigmaPr()) >= nsigmaTOF) { + registry.fill(HIST("hReco_PID_EtaPhiPt_Deuteron"), track.eta(), track.phi(), track.pt()); } registry.fill(HIST("hnSigmaTPCVsPt_De_MC"), track.pt(), track.tpcNSigmaDe()); registry.fill(HIST("hnSigmaTOFVsPt_De_MC"), track.pt(), track.tofNSigmaDe()); @@ -951,11 +947,9 @@ struct hadronnucleicorrelation { registry.fill(HIST("hResEta_AntiDeuteron"), track.eta_MC(), track.eta() - track.eta_MC()); registry.fill(HIST("hResPhi_AntiDeuteron"), track.phi_MC(), track.phi() - track.phi_MC()); - if (TMath::Abs(track.tpcNSigmaDe()) < nsigmaTPC && TMath::Abs(track.tpcNSigmaPr()) >= nsigmaTPC) { - if (TMath::Abs(track.tofNSigmaDe()) < nsigmaTOF && TMath::Abs(track.tofNSigmaPr()) >= nsigmaTOF) { - isAntiDeTPCTOF = true; - registry.fill(HIST("hReco_PID_EtaPhiPt_Deuteron"), track.eta(), track.phi(), track.pt() * -1); - } + if (TMath::Abs(track.tpcNSigmaDe()) < nsigmaTPC && TMath::Abs(track.tofNSigmaDe()) < nsigmaTOF && TMath::Abs(track.tofNSigmaPr()) >= nsigmaTOF) { + isAntiDeTPCTOF = true; + registry.fill(HIST("hReco_PID_EtaPhiPt_Deuteron"), track.eta(), track.phi(), track.pt() * -1); } registry.fill(HIST("hnSigmaTPCVsPt_De_MC"), track.pt() * -1, track.tpcNSigmaDe()); registry.fill(HIST("hnSigmaTOFVsPt_De_MC"), track.pt() * -1, track.tofNSigmaDe()); From e792e4cf68f8d3574c02e69f7631e525cb5d4d08 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:07:03 +0200 Subject: [PATCH 06/60] Improve histogram binning (#7551) * Add resolution histogram and fix abs() function * Optimize PID * Improved rotational background * improved background * Improve histogram binning --- PWGLF/Tasks/Resonances/highmasslambda.cxx | 147 +++++++--------------- 1 file changed, 46 insertions(+), 101 deletions(-) diff --git a/PWGLF/Tasks/Resonances/highmasslambda.cxx b/PWGLF/Tasks/Resonances/highmasslambda.cxx index bcb275a39e4..c9b59e17180 100644 --- a/PWGLF/Tasks/Resonances/highmasslambda.cxx +++ b/PWGLF/Tasks/Resonances/highmasslambda.cxx @@ -79,7 +79,6 @@ struct highmasslambda { Configurable additionalEvSel{"additionalEvSel", true, "additionalEvSel"}; Configurable additionalEvSel2{"additionalEvSel2", false, "additionalEvSel2"}; Configurable fillDefault{"fillDefault", false, "fill Occupancy"}; - Configurable fillOccupancy{"fillOccupancy", true, "fill Occupancy"}; Configurable cfgOccupancyCut{"cfgOccupancyCut", 2500, "Occupancy cut"}; Configurable fillDecayLength{"fillDecayLength", true, "fill decay length"}; Configurable fillPolarization{"fillPolarization", false, "fill polarization"}; @@ -192,7 +191,7 @@ struct highmasslambda { AxisSpec centAxis = {8, 0, 80, "V0M (%)"}; // AxisSpec ptProtonAxis = {16, 0.0, 8, "V0M (%)"}; AxisSpec dcaAxis = {dcaBinning, "DCAxy"}; - AxisSpec dcatoPVAxis = {50, 0.0, 0.4, "V0M (%)"}; + AxisSpec dcatoPVAxis = {50, 0.0, 0.5, "V0M (%)"}; AxisSpec occupancyAxis = {occupancyBinning, "occupancy"}; AxisSpec ptProtonAxis = {ptProtonBinning, "pT proton"}; @@ -237,34 +236,16 @@ struct highmasslambda { histos.add("hPsiTPC", "PsiTPC", kTH3F, {centAxis, phiAxis, occupancyAxis}); histos.add("hPsiTPCR", "PsiTPCR", kTH3F, {centAxis, phiAxis, occupancyAxis}); histos.add("hPsiTPCL", "PsiTPCL", kTH3F, {centAxis, phiAxis, occupancyAxis}); + if (fillDefault) { - if (fillDecayLength) { - histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum}); - histos.add("hSparseV2SAMixedEvent_V2", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum}); - histos.add("hSparseV2SASameEventRotational_V2", "hSparseV2SASameEventRotational_V2", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum}); - } - histos.add("hSparseV2SASameEvent_V2_new", "hSparseV2SASameEvent_V2_new", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - histos.add("hSparseV2SAMixedEvent_V2_new", "hSparseV2SAMixedEvent_V2_new", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - histos.add("hSparseV2SASameEventRotational_V2_new", "hSparseV2SASameEventRotational_V2_new", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - } - if (fillOccupancy) { - if (fillDecayLength) { - histos.add("hSparseV2SASameEvent_V2_occupancy", "hSparseV2SASameEvent_V2_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum, dcaAxis}); - histos.add("hSparseV2SASameEventRotational_V2_occupancy", "hSparseV2SASameEventRotational_V2_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum, dcaAxis}); - histos.add("hSparseV2SAMixedEvent_V2_occupancy", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum, dcaAxis}); - } - histos.add("hSparseV2SASameEvent_V2_new_occupancy", "hSparseV2SASameEvent_V2_new_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - histos.add("hSparseV2SASameEventRotational_V2_new_occupancy", "hSparseV2SASameEventRotational_V2_new_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - histos.add("hSparseV2SAMixedEvent_V2_new_occupancy", "hSparseV2SAMixedEvent_V2_new", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - } else { - if (fillDecayLength) { - histos.add("hSparseV2SASameEvent_V2_occupancy", "hSparseV2SASameEvent_V2_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum, dcaAxis}); - histos.add("hSparseV2SASameEventRotational_V2_occupancy", "hSparseV2SASameEventRotational_V2_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum, dcaAxis}); - histos.add("hSparseV2SAMixedEvent_V2_occupancy", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, thnAxisDCASum, dcaAxis}); - } - histos.add("hSparseV2SASameEvent_V2_new_occupancy", "hSparseV2SASameEvent_V2_new_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - histos.add("hSparseV2SASameEventRotational_V2_new_occupancy", "hSparseV2SASameEventRotational_V2_new_occupancy", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); - histos.add("hSparseV2SAMixedEvent_V2_new_occupancy", "hSparseV2SAMixedEvent_V2_new", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); + histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); + histos.add("hSparseV2SASameEventRotational_V2", "hSparseV2SASameEventRotational", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); + histos.add("hSparseV2SAMixedEvent_V2", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcaAxis, ptProtonAxis}); + } + if (fillDecayLength) { + histos.add("hSparseV2SASameEvent_V2_dcatopv", "hSparseV2SASameEvent_V2_dcatopv", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcatoPVAxis, ptProtonAxis}); + histos.add("hSparseV2SASameEventRotational_V2_dcatopv", "hSparseV2SASameEventRotational_V2_dcatopv", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcatoPVAxis, ptProtonAxis}); + histos.add("hSparseV2SAMixedEvent_V2_dcatopv", "hSparseV2SAMixedEvent_V2_dcatopv", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSP, dcatoPVAxis, ptProtonAxis}); } if (fillPolarization) { histos.add("hSparseV2SASameEventplus_SA", "hSparseV2SASameEventplus_SA", HistType::kTHnSparseF, {thnAxisInvMass, ptLambdaBinning, thnAxisSA, thnAxisPhiminusPsi, thnAxisCentrality}); @@ -743,27 +724,15 @@ struct highmasslambda { dcasum = v0.dcav0topv() - track1.dcaXY(); } histos.fill(HIST("hMassvsDecaySum"), Lambdac.M(), dcasum); - if (fillDefault && Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SASameEvent_V2"), Lambdac.M(), Lambdac.Pt(), v2, dcasum); - } - histos.fill(HIST("hSparseV2SASameEvent_V2_new"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); - } - if (fillOccupancy && occupancy < cfgOccupancyCut) { - if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SASameEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); - } - histos.fill(HIST("hSparseV2SASameEvent_V2_new_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); + if (occupancy < cfgOccupancyCut && Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { + if (fillDefault) { + histos.fill(HIST("hSparseV2SASameEvent_V2"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); } - } else { - if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SASameEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); - } - histos.fill(HIST("hSparseV2SASameEvent_V2_new_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); + if (fillDecayLength) { + 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; @@ -782,37 +751,26 @@ struct highmasslambda { if (!useSP) { v2Rot = TMath::Cos(2.0 * phiminuspsiRot); } - if (fillDefault && LambdacRot.M() > cMinLambdaMass && LambdacRot.M() <= cMaxLambdaMass && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2.0 && LambdacRot.Pt() <= 6.0) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SASameEventRotational_V2"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, dcasum); - } - histos.fill(HIST("hSparseV2SASameEventRotational_V2_new"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, TMath::Abs(track1.dcaXY()), Proton.Pt()); - } - if (fillOccupancy && occupancy < cfgOccupancyCut) { - if (LambdacRot.M() > cMinLambdaMass && LambdacRot.M() <= cMaxLambdaMass && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2.0 && LambdacRot.Pt() <= 6.0) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SASameEventRotational_V2_occupancy"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, dcasum, TMath::Abs(track1.dcaXY())); - } - histos.fill(HIST("hSparseV2SASameEventRotational_V2_new_occupancy"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, TMath::Abs(track1.dcaXY()), Proton.Pt()); + + if (occupancy < cfgOccupancyCut && LambdacRot.M() > cMinLambdaMass && LambdacRot.M() <= cMaxLambdaMass && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2.0 && LambdacRot.Pt() <= 6.0) { + if (fillDefault) { + histos.fill(HIST("hSparseV2SASameEventRotational_V2"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, TMath::Abs(track1.dcaXY()), Proton.Pt()); } - } else { - if (LambdacRot.M() > cMinLambdaMass && LambdacRot.M() <= cMaxLambdaMass && TMath::Abs(LambdacRot.Rapidity()) < confRapidity && LambdacRot.Pt() > 2.0 && LambdacRot.Pt() <= 6.0) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SASameEventRotational_V2_occupancy"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, dcasum, TMath::Abs(track1.dcaXY())); - } - histos.fill(HIST("hSparseV2SASameEventRotational_V2_new_occupancy"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, TMath::Abs(track1.dcaXY()), Proton.Pt()); + if (fillDecayLength) { + histos.fill(HIST("hSparseV2SASameEventRotational_V2_dcatopv"), LambdacRot.M(), LambdacRot.Pt(), v2Rot, v0.dcav0topv(), Proton.Pt()); } } } } - ROOT::Math::Boost boost{Lambdac.BoostToCM()}; - fourVecDauCM = boost(Kshort); - threeVecDauCM = fourVecDauCM.Vect(); - threeVecDauCMXY = ROOT::Math::XYZVector(threeVecDauCM.X(), threeVecDauCM.Y(), 0.); - beamvector = ROOT::Math::XYZVector(0, 0, 1); - auto cosThetaStar = beamvector.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(beamvector.Mag2()); - auto SA = cosThetaStar * TMath::Sin(2.0 * phiminuspsi); if (fillPolarization) { + ROOT::Math::Boost boost{Lambdac.BoostToCM()}; + fourVecDauCM = boost(Kshort); + threeVecDauCM = fourVecDauCM.Vect(); + threeVecDauCMXY = ROOT::Math::XYZVector(threeVecDauCM.X(), threeVecDauCM.Y(), 0.); + beamvector = ROOT::Math::XYZVector(0, 0, 1); + auto cosThetaStar = beamvector.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(beamvector.Mag2()); + auto SA = cosThetaStar * TMath::Sin(2.0 * phiminuspsi); + if (track1.sign() > 0) { histos.fill(HIST("hSparseV2SASameEventplus_SA"), Lambdac.M(), Lambdac.Pt(), cosThetaStar, phiminuspsi, centrality); histos.fill(HIST("hSparseV2SASameEventplus_SA_A0"), Lambdac.M(), Lambdac.Pt(), cosThetaStar * cosThetaStar, phiminuspsi, centrality); @@ -855,7 +813,8 @@ struct highmasslambda { auto centrality = collision1.centFT0C(); auto psiFT0C = collision1.psiFT0C(); auto QFT0C = collision1.qFT0C(); - int occupancy = collision1.trackOccupancyInTimeRange(); + int occupancy1 = collision1.trackOccupancyInTimeRange(); + int occupancy2 = collision1.trackOccupancyInTimeRange(); for (auto& [track1, v0] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!selectionTrack(track1)) { continue; @@ -922,38 +881,24 @@ struct highmasslambda { if (!useSignDCAV0) { dcasum = v0.dcav0topv() - track1.dcaXY(); } - // auto diffangle = Proton.Phi() - Lambdac.Phi(); - // auto decaylength = TMath::Abs((track1.dcaXY() / TMath::Sin(diffangle)) / (Lambdac.P() / 2.286)); - // auto dcasum = TMath::Sqrt(track1.dcaXY() * track1.dcaXY() + v0.dcav0topv() * v0.dcav0topv()); - if (fillDefault && Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SAMixedEvent_V2"), Lambdac.M(), Lambdac.Pt(), v2, dcasum); - } - histos.fill(HIST("hSparseV2SAMixedEvent_V2_new"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); - } - if (fillOccupancy && occupancy < cfgOccupancyCut) { - if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SAMixedEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); - } - histos.fill(HIST("hSparseV2SAMixedEvent_V2_new_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); + + 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) { + histos.fill(HIST("hSparseV2SAMixedEvent_V2"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); } - } else { - if (Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass) { - if (fillDecayLength) { - histos.fill(HIST("hSparseV2SAMixedEvent_V2_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, dcasum, TMath::Abs(track1.dcaXY())); - } - histos.fill(HIST("hSparseV2SAMixedEvent_V2_new_occupancy"), Lambdac.M(), Lambdac.Pt(), v2, TMath::Abs(track1.dcaXY()), Proton.Pt()); + if (fillDecayLength) { + histos.fill(HIST("hSparseV2SAMixedEvent_V2_dcatopv"), Lambdac.M(), Lambdac.Pt(), v2, v0.dcav0topv(), Proton.Pt()); } } - ROOT::Math::Boost boost{Lambdac.BoostToCM()}; - fourVecDauCM = boost(Kshort); - threeVecDauCM = fourVecDauCM.Vect(); - threeVecDauCMXY = ROOT::Math::XYZVector(threeVecDauCM.X(), threeVecDauCM.Y(), 0.); - beamvector = ROOT::Math::XYZVector(0, 0, 1); - auto cosThetaStar = beamvector.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(beamvector.Mag2()); - auto SA = cosThetaStar * TMath::Sin(2.0 * phiminuspsi); if (fillPolarization) { + ROOT::Math::Boost boost{Lambdac.BoostToCM()}; + fourVecDauCM = boost(Kshort); + threeVecDauCM = fourVecDauCM.Vect(); + threeVecDauCMXY = ROOT::Math::XYZVector(threeVecDauCM.X(), threeVecDauCM.Y(), 0.); + beamvector = ROOT::Math::XYZVector(0, 0, 1); + auto cosThetaStar = beamvector.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(beamvector.Mag2()); + auto SA = cosThetaStar * TMath::Sin(2.0 * phiminuspsi); + if (track1.sign() > 0) { histos.fill(HIST("hSparseV2SAMixedEventplus_SA"), Lambdac.M(), Lambdac.Pt(), cosThetaStar, phiminuspsi, centrality); histos.fill(HIST("hSparseV2SAMixedEventplus_SA_A0"), Lambdac.M(), Lambdac.Pt(), cosThetaStar * cosThetaStar, phiminuspsi, centrality); From 96f2e76d4928cbe5e84adb298014f3197177cc79 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Wed, 4 Sep 2024 01:05:26 +0200 Subject: [PATCH 07/60] PWGCF: DptDpt, Addressing extra event selection checks separately (#7552) * PWGCF: DptDpt, Addressing extra event selection checks separately * Please consider the following formatting changes --------- Co-authored-by: Victor Co-authored-by: ALICE Action Bot --- PWGCF/TableProducer/dptdptfilter.h | 49 +++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index de9b2c9a598..8866784f1e4 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -94,12 +94,16 @@ enum CentMultEstimatorType { /// \enum TriggerSelectionType /// \brief The type of trigger to apply for event selection enum TriggerSelectionType { - kNONE = 0, ///< do not use trigger selection - kMB, ///< Minimum bias trigger - kVTXTOFMATCHED, ///< at least one vertex contributor is matched to TOF - kVTXTRDMATCHED, ///< at least one vertex contributor is matched to TRD - kVTXTRDTOFMATCHED, ///< at least one vertex contributor is matched to TRD and TOF - knEventSelection ///< number of triggers for event selection + kNONE = 0, ///< do not use trigger selection + kMB, ///< Minimum bias trigger + kMBEXTRA, ///< Additional Run3 event quality + kVTXTOFMATCHED, ///< at least one vertex contributor is matched to TOF + kVTXTRDMATCHED, ///< at least one vertex contributor is matched to TRD + kVTXTRDTOFMATCHED, ///< at least one vertex contributor is matched to TRD and TOF + kEXTRAVTXTOFMATCHED, ///< Additional Run3 event quality and at least one vertex contributor is matched to TOF + kEXTRAVTXTRDMATCHED, ///< Additional Run3 event quality and at least one vertex contributor is matched to TRD + kEXTRAVTXTRDTOFMATCHED, ///< Additional Run3 event quality and at least one vertex contributor is matched to TRD and TOF + knEventSelection ///< number of triggers for event selection }; /// \enum StrongDebugging @@ -312,12 +316,20 @@ inline TriggerSelectionType getTriggerSelection(std::string const& triggstr) { if (triggstr.empty() || triggstr == "MB") { return kMB; + } else if (triggstr == "MBEXTRA") { + return kMBEXTRA; } else if (triggstr == "VTXTOFMATCHED") { return kVTXTOFMATCHED; } else if (triggstr == "VTXTRDMATCHED") { return kVTXTRDMATCHED; } else if (triggstr == "VTXTRDTOFMATCHED") { return kVTXTRDTOFMATCHED; + } else if (triggstr == "EXTRAVTXTOFMATCHED") { + return kEXTRAVTXTOFMATCHED; + } else if (triggstr == "EXTRAVTXTRDMATCHED") { + return kEXTRAVTXTRDMATCHED; + } else if (triggstr == "EXTRAVTXTRDTOFMATCHED") { + return kEXTRAVTXTRDTOFMATCHED; } else if (triggstr == "None") { return kNONE; } else { @@ -481,9 +493,10 @@ inline bool triggerSelectionReco(CollisionObject const& collision) case kppRun3: case kPbPbRun3: { auto run3Accepted = [](auto const& coll) { + return coll.sel8(); + }; + auto run3ExtraAccepted = [](auto const& coll) { return coll.sel8() && - coll.selection_bit(aod::evsel::kNoITSROFrameBorder) && - coll.selection_bit(aod::evsel::kNoTimeFrameBorder) && coll.selection_bit(aod::evsel::kNoSameBunchPileup) && coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && coll.selection_bit(aod::evsel::kIsVertexITSTPC); @@ -494,6 +507,11 @@ inline bool triggerSelectionReco(CollisionObject const& collision) trigsel = true; } break; + case kMBEXTRA: + if (run3ExtraAccepted(collision)) { + trigsel = true; + } + break; case kVTXTOFMATCHED: if (run3Accepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { trigsel = true; @@ -509,6 +527,21 @@ inline bool triggerSelectionReco(CollisionObject const& collision) trigsel = true; } break; + case kEXTRAVTXTOFMATCHED: + if (run3ExtraAccepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + trigsel = true; + } + break; + case kEXTRAVTXTRDMATCHED: + if (run3ExtraAccepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched)) { + trigsel = true; + } + break; + case kEXTRAVTXTRDTOFMATCHED: + if (run3ExtraAccepted(collision) && collision.selection_bit(aod::evsel::kIsVertexTRDmatched) && collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + trigsel = true; + } + break; case kNONE: trigsel = true; break; From 32ac37a91f46247b2db41d9d266d03fcc573084a Mon Sep 17 00:00:00 2001 From: smaff92 <33285879+smaff92@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:01:55 +0900 Subject: [PATCH 08/60] PWGJE: Added statistical prompt photon task to CMake (#7545) * Added K*(892) functionality, as well as a host of optimizations and features * Please consider the following formatting changes * Megalinter fixes for pull 6940 * Please consider the following formatting changes * Fixed rand_r() bug * Please consider the following formatting changes * Bugfix to random evaluator * New update, properly creates the response matrix efficiency on the generator level * Bugfix on the MC-REC matching * Please consider the following formatting changes * Megalinter requests for if/else braces * Please consider the following formatting changes * Reorganized and optimized histogram booking * Please consider the following formatting changes * Please consider the following formatting changes * PWGJE: Added phi gen-to-rec matched finding * Please consider the following formatting changes * Bugfix to fix whitespace/tab issue * Bugfix to remove tab and replace it with whitespace, take 2 * Bugfix to remove tab and replace it with whitespace, take 3 * PWGJE: Added Real rec jets per event estimation in MC * PWGJE: Quick fix of histogram name typo * PWGJE: First addition of a new, statistical prompt photon analysis. Added MC functionality to perform large-statistics closure test. Data analysis to follow shortly. * PWGJE: Added Stat Prompt Photon Task to CMake file * Please consider the following formatting changes * Update statPromptPhoton.cxx * Update statPromptPhoton.cxx * Please consider the following formatting changes * Update statPromptPhoton.cxx * Update CMakeLists.txt --------- Co-authored-by: ALICE Action Bot --- PWGJE/Tasks/CMakeLists.txt | 4 ++++ PWGJE/Tasks/statPromptPhoton.cxx | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index eaa7bb9ec2b..adbd4e141a5 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -160,6 +160,10 @@ if(FastJet_FOUND) SOURCES bjetTreeCreator.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stat-prompt-photon + SOURCES statPromptPhoton.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(full-jet-spectra-pp SOURCES fulljetspectrapp.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/statPromptPhoton.cxx b/PWGJE/Tasks/statPromptPhoton.cxx index f50d48af422..35907b1460a 100644 --- a/PWGJE/Tasks/statPromptPhoton.cxx +++ b/PWGJE/Tasks/statPromptPhoton.cxx @@ -72,7 +72,6 @@ struct statPromptPhoton { Configurable cfgMinNCells{"MinNCelss", 2, "Minimal amount of cells per cluster"}; Configurable cfgMaxNLM{"MaxNLM", 2, "Maximal amount of local Maxima per cluster"}; Configurable cfgExoticContribution{"ExoticContribution", false, "Exotic cluster in the data"}; - Configurable cfgtrkMinPt{"cfgtrkMinPt", 0.15, "set track min pT"}; Configurable cfgtrkMaxEta{"cfgtrkMaxEta", 0.6, "set track max Eta"}; Configurable cfgMinR{"MinR", 0.1, "Min. Radii of Delta R cone around photon trigger"}; @@ -116,6 +115,7 @@ struct statPromptPhoton { Filter mcPosZFilter = nabs(aod::mccollision::posZ) < cfgVtxCut; using MCCells = o2::soa::Join; + using MCClusters = o2::soa::Join; using selectedCollisions = soa::Join; using selectedMCCollisions = aod::McCollisions; @@ -136,10 +136,10 @@ struct statPromptPhoton { ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// template + double GetPtHadSum(const Tracks& tracks, const Trigger& trigger, double MinR, double MaxR, bool IsStern, bool IsParticle, bool DodR) { double eta_trigger, phi_trigger; - if constexpr (requires { trigger.eta(); }) { eta_trigger = trigger.eta(); phi_trigger = trigger.phi(); @@ -153,6 +153,7 @@ struct statPromptPhoton { double phi_track = track.phi(); double eta_track = track.eta(); double pt_track = track.pt(); + if constexpr (requires { track.isPVContributor(); }) { if (!IsParticle) { if (!trackSelection(track)) { @@ -259,6 +260,7 @@ struct statPromptPhoton { }; // end of track selection ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////// // PROCESS @@ -372,6 +374,7 @@ struct statPromptPhoton { if (!recocoll.sel8()) return; if (fabs(recocoll.posZ()) > cfgVtxCut) + return; } From 6087cb378bf471f4397d52de1c2bfaa54327aad7 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:52:26 +0530 Subject: [PATCH 09/60] [QAEff] Fix the filled tracks for Ptvsradius (#7547) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 37 +++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index ca4b78ac20f..0e1c023fc6e 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -1050,15 +1050,8 @@ struct QaEfficiency { } if (doPtRadius) { hPtRadiusItsTpc[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusItsTpcPrm[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusItsTpcStr[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusItsTpcTer[histogramIndex]->Fill(mcParticle.pt(), radius); - if (passedTOF) { hPtRadiusItsTpcTof[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusItsTpcTofPrm[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusItsTpcTofStr[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusItsTpcTofTer[histogramIndex]->Fill(mcParticle.pt(), radius); } } } @@ -1098,6 +1091,12 @@ struct QaEfficiency { hEtaItsTpcTofPrm[histogramIndex]->Fill(mcParticle.eta()); hPhiItsTpcTofPrm[histogramIndex]->Fill(mcParticle.phi()); } + if (doPtRadius) { + hPtRadiusItsTpcPrm[histogramIndex]->Fill(mcParticle.pt(), radius); + if (passedTOF) { + hPtRadiusItsTpcTofPrm[histogramIndex]->Fill(mcParticle.pt(), radius); + } + } } } else if (mcParticle.getProcess() == 4) { // Particle decay // Checking mothers @@ -1123,6 +1122,12 @@ struct QaEfficiency { if (passedTOF) { hPtItsTpcTofStr[histogramIndex]->Fill(mcParticle.pt()); } + if (doPtRadius) { + hPtRadiusItsTpcStr[histogramIndex]->Fill(mcParticle.pt(), radius); + if (passedTOF) { + hPtRadiusItsTpcTofStr[histogramIndex]->Fill(mcParticle.pt(), radius); + } + } } if (isFinal(mcParticle)) { if (passedITS && passedTPC && motherIsAccepted) { @@ -1131,6 +1136,12 @@ struct QaEfficiency { if (passedTOF) { hPtItsTpcTofTer[histogramIndex]->Fill(mcParticle.pt()); } + if (doPtRadius) { + hPtRadiusItsTpcTer[histogramIndex]->Fill(mcParticle.pt(), radius); + if (passedTOF) { + hPtRadiusItsTpcTofTer[histogramIndex]->Fill(mcParticle.pt(), radius); + } + } } } } else { // Material @@ -1184,6 +1195,9 @@ struct QaEfficiency { hPtGeneratedPrm[histogramIndex]->Fill(mcParticle.pt()); hEtaGeneratedPrm[histogramIndex]->Fill(mcParticle.eta()); hPhiGeneratedPrm[histogramIndex]->Fill(mcParticle.phi()); + if (doPtRadius) { + hPtRadiusGeneratedPrm[histogramIndex]->Fill(mcParticle.pt(), radius); + } } else { if (mcParticle.getProcess() == 4) { // Particle decay // Checking mothers @@ -1205,8 +1219,14 @@ struct QaEfficiency { } if (motherIsAccepted) { hPtGeneratedStr[histogramIndex]->Fill(mcParticle.pt()); + if (doPtRadius) { + hPtRadiusGeneratedStr[histogramIndex]->Fill(mcParticle.pt(), radius); + } if (isFinal(mcParticle)) { hPtGeneratedTer[histogramIndex]->Fill(mcParticle.pt()); + if (doPtRadius) { + hPtRadiusGeneratedTer[histogramIndex]->Fill(mcParticle.pt(), radius); + } } } } else { // Material @@ -1221,9 +1241,6 @@ struct QaEfficiency { } if (doPtRadius) { hPtRadiusGenerated[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusGeneratedPrm[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusGeneratedStr[histogramIndex]->Fill(mcParticle.pt(), radius); - hPtRadiusGeneratedTer[histogramIndex]->Fill(mcParticle.pt(), radius); } } From b75119ecd288184fb4efba65153ca7691bb8c7ed Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Wed, 4 Sep 2024 11:48:25 +0200 Subject: [PATCH 10/60] add bin (#7532) Co-authored-by: junleekim --- Common/Tasks/qVectorsCorrection.cxx | 73 ++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/Common/Tasks/qVectorsCorrection.cxx b/Common/Tasks/qVectorsCorrection.cxx index 5c3c8af7a31..bc9c555e154 100644 --- a/Common/Tasks/qVectorsCorrection.cxx +++ b/Common/Tasks/qVectorsCorrection.cxx @@ -73,6 +73,8 @@ struct qVectorsCorrection { Configurable cfgQAAll{"cfgQAAll", false, "draw all q-vector steps"}; Configurable cfgQAFinal{"cfgQAFinal", false, "draw final q-vector steps"}; + Configurable cfgQAFlowStudy{"cfgQAFlowStudy", false, "configurable for flow study"}; + Configurable cfgQAOccupancyStudy{"cfgQAOccupancyStudy", false, "configurable for occupancy study"}; Configurable cfgMinPt{"cfgMinPt", 0.15, "Minimum transverse momentum for charged track"}; Configurable cfgMaxEta{"cfgMaxEta", 0.8, "Maximum pseudorapidiy for charged track"}; @@ -90,6 +92,7 @@ struct qVectorsCorrection { ConfigurableAxis cfgaxispt{"cfgaxispt", {100, 0, 10}, ""}; ConfigurableAxis cfgaxisCentMerged{"cfgaxisCentMerged", {20, 0, 100}, ""}; ConfigurableAxis cfgaxisAzimuth{"cfgaxisAzimuth", {72, 0, 2.0 * constants::math::PI}, ""}; + ConfigurableAxis cfgaxisOccupancy{"cfgaxisOccupancy", {VARIABLE_WIDTH, -1, 0, 100, 500, 1000, 2000, 3000, 4000, 5000, 10000, 99999}, ""}; // Helper variables. EventPlaneHelper helperEP; @@ -169,6 +172,8 @@ struct qVectorsCorrection { AxisSpec axisPt{cfgaxispt, "trasverse momentum"}; AxisSpec axisCentMerged{cfgaxisCentMerged, "merged centrality"}; AxisSpec axisAzimuth{cfgaxisAzimuth, "relative azimuthal angle"}; + AxisSpec axisOccupancy{cfgaxisOccupancy, "Occupancy"}; + histosQA.add("histCentFull", "Centrality distribution for valid events", HistType::kTH1F, {axisCent}); @@ -181,11 +186,23 @@ struct qVectorsCorrection { histosQA.add(Form("histEvtPlRefAUncorV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); histosQA.add(Form("histEvtPlRefBUncorV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); + if (cfgQAOccupancyStudy) { + histosQA.add(Form("histQvecOccUncorV%d", cfgnMods->at(i)), "", {HistType::kTHnSparseF, {axisQvecF, axisQvecF, axisCent, axisOccupancy}}); + histosQA.add(Form("histQvecRefAOccUncorV%d", cfgnMods->at(i)), "", {HistType::kTHnSparseF, {axisQvecF, axisQvecF, axisCent, axisOccupancy}}); + histosQA.add(Form("histQvecRefBOccUncorV%d", cfgnMods->at(i)), "", {HistType::kTHnSparseF, {axisQvecF, axisQvecF, axisCent, axisOccupancy}}); + } + if (cfgQAFinal) { histosQA.add(Form("histQvecFinalV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvec, axisQvec, axisCent}}); histosQA.add(Form("histQvecRefAFinalV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvec, axisQvec, axisCent}}); histosQA.add(Form("histQvecRefBFinalV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvec, axisQvec, axisCent}}); + if (cfgQAOccupancyStudy) { + histosQA.add(Form("histQvecOccFinalV%d", cfgnMods->at(i)), "", {HistType::kTHnSparseF, {axisQvecF, axisQvecF, axisCent, axisOccupancy}}); + histosQA.add(Form("histQvecRefAOccFinalV%d", cfgnMods->at(i)), "", {HistType::kTHnSparseF, {axisQvecF, axisQvecF, axisCent, axisOccupancy}}); + histosQA.add(Form("histQvecRefBOccFinalV%d", cfgnMods->at(i)), "", {HistType::kTHnSparseF, {axisQvecF, axisQvecF, axisCent, axisOccupancy}}); + } + histosQA.add(Form("histQvecRes_SigRefAV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisQvecF, axisCent}}); histosQA.add(Form("histQvecRes_SigRefBV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisQvecF, axisCent}}); histosQA.add(Form("histQvecRes_RefARefBV%d", cfgnMods->at(i)), "", {HistType::kTH2F, {axisQvecF, axisCent}}); @@ -303,9 +320,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[DetId] > 1e-8) { histosQA.fill(HIST("histQvecUncorV2"), vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], vec.cent()); histosQA.fill(HIST("histEvtPlUncorV2"), helperEP.GetEventPlane(vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecOccUncorV2"), vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecFinalV2"), vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecOccFinalV2"), vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { 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()); @@ -318,9 +341,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[RefAId] > 1e-8) { histosQA.fill(HIST("histQvecRefAUncorV2"), vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], vec.cent()); histosQA.fill(HIST("histEvtPlRefAUncorV2"), helperEP.GetEventPlane(vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefAOccUncorV2"), vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecRefAFinalV2"), vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlRefAFinalV2"), helperEP.GetEventPlane(vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefAOccFinalV2"), vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { histosQA.fill(HIST("histQvecRefARectrV2"), vec.qvecRe()[RefAInd + 1], vec.qvecIm()[RefAInd + 1], vec.cent()); histosQA.fill(HIST("histQvecRefATwistV2"), vec.qvecRe()[RefAInd + 2], vec.qvecIm()[RefAInd + 2], vec.cent()); @@ -333,9 +362,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[RefBId] > 1e-8) { histosQA.fill(HIST("histQvecRefBUncorV2"), vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], vec.cent()); histosQA.fill(HIST("histEvtPlRefBUncorV2"), helperEP.GetEventPlane(vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefBOccUncorV2"), vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecRefBFinalV2"), vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlRefBFinalV2"), helperEP.GetEventPlane(vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefBOccFinalV2"), vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { histosQA.fill(HIST("histQvecRefBRectrV2"), vec.qvecRe()[RefBInd + 1], vec.qvecIm()[RefBInd + 1], vec.cent()); histosQA.fill(HIST("histQvecRefBTwistV2"), vec.qvecRe()[RefBInd + 2], vec.qvecIm()[RefBInd + 2], vec.cent()); @@ -358,7 +393,13 @@ struct qVectorsCorrection { if (vec.qvecAmp()[DetId] > 1e-8) { histosQA.fill(HIST("histQvecUncorV3"), vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], vec.cent()); histosQA.fill(HIST("histEvtPlUncorV3"), helperEP.GetEventPlane(vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecOccUncorV3"), vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecOccFinalV3"), vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } histosQA.fill(HIST("histQvecFinalV3"), vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlFinalV3"), helperEP.GetEventPlane(vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], nmode), vec.cent()); if (cfgQAAll) { @@ -373,9 +414,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[RefAId] > 1e-8) { histosQA.fill(HIST("histQvecRefAUncorV3"), vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], vec.cent()); histosQA.fill(HIST("histEvtPlRefAUncorV3"), helperEP.GetEventPlane(vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefAOccUncorV3"), vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecRefAFinalV3"), vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlRefAFinalV3"), helperEP.GetEventPlane(vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefAOccFinalV3"), vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { histosQA.fill(HIST("histQvecRefARectrV3"), vec.qvecRe()[RefAInd + 1], vec.qvecIm()[RefAInd + 1], vec.cent()); histosQA.fill(HIST("histQvecRefATwistV3"), vec.qvecRe()[RefAInd + 2], vec.qvecIm()[RefAInd + 2], vec.cent()); @@ -388,9 +435,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[RefBId] > 1e-8) { histosQA.fill(HIST("histQvecRefBUncorV3"), vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], vec.cent()); histosQA.fill(HIST("histEvtPlRefBUncorV3"), helperEP.GetEventPlane(vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefBOccUncorV3"), vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecRefBFinalV3"), vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlRefBFinalV3"), helperEP.GetEventPlane(vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefBOccFinalV3"), vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { histosQA.fill(HIST("histQvecRefBRectrV3"), vec.qvecRe()[RefBInd + 1], vec.qvecIm()[RefBInd + 1], vec.cent()); histosQA.fill(HIST("histQvecRefBTwistV3"), vec.qvecRe()[RefBInd + 2], vec.qvecIm()[RefBInd + 2], vec.cent()); @@ -413,9 +466,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[DetId] > 1e-8) { histosQA.fill(HIST("histQvecUncorV4"), vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], vec.cent()); histosQA.fill(HIST("histEvtPlUncorV4"), helperEP.GetEventPlane(vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecOccUncorV4"), vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecFinalV4"), vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlFinalV4"), helperEP.GetEventPlane(vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecOccFinalV4"), vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { histosQA.fill(HIST("histQvecRectrV4"), vec.qvecRe()[DetInd + 1], vec.qvecIm()[DetInd + 1], vec.cent()); histosQA.fill(HIST("histQvecTwistV4"), vec.qvecRe()[DetInd + 2], vec.qvecIm()[DetInd + 2], vec.cent()); @@ -428,9 +487,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[RefAId] > 1e-8) { histosQA.fill(HIST("histQvecRefAUncorV4"), vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], vec.cent()); histosQA.fill(HIST("histEvtPlRefAUncorV4"), helperEP.GetEventPlane(vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefAOccUncorV4"), vec.qvecRe()[RefAInd], vec.qvecIm()[RefAInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecRefAFinalV4"), vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlRefAFinalV4"), helperEP.GetEventPlane(vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefAOccFinalV4"), vec.qvecRe()[RefAInd + 3], vec.qvecIm()[RefAInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { histosQA.fill(HIST("histQvecRefARectrV4"), vec.qvecRe()[RefAInd + 1], vec.qvecIm()[RefAInd + 1], vec.cent()); histosQA.fill(HIST("histQvecRefATwistV4"), vec.qvecRe()[RefAInd + 2], vec.qvecIm()[RefAInd + 2], vec.cent()); @@ -443,9 +508,15 @@ struct qVectorsCorrection { if (vec.qvecAmp()[RefBId] > 1e-8) { histosQA.fill(HIST("histQvecRefBUncorV4"), vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], vec.cent()); histosQA.fill(HIST("histEvtPlRefBUncorV4"), helperEP.GetEventPlane(vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefBOccUncorV4"), vec.qvecRe()[RefBInd], vec.qvecIm()[RefBInd], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAFinal) { histosQA.fill(HIST("histQvecRefBFinalV4"), vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], vec.cent()); histosQA.fill(HIST("histEvtPlRefBFinalV4"), helperEP.GetEventPlane(vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], nmode), vec.cent()); + if (cfgQAOccupancyStudy) { + histosQA.fill(HIST("histQvecRefBOccFinalV4"), vec.qvecRe()[RefBInd + 3], vec.qvecIm()[RefBInd + 3], vec.cent(), vec.trackOccupancyInTimeRange()); + } if (cfgQAAll) { histosQA.fill(HIST("histQvecRefBRectrV4"), vec.qvecRe()[RefBInd + 1], vec.qvecIm()[RefBInd + 1], vec.cent()); histosQA.fill(HIST("histQvecRefBTwistV4"), vec.qvecRe()[RefBInd + 2], vec.qvecIm()[RefBInd + 2], vec.cent()); @@ -480,7 +551,7 @@ struct qVectorsCorrection { for (uint i = 0; i < cfgnMods->size(); i++) { fillHistosQvec(qVec, cfgnMods->at(i)); - if (cfgQAFinal) { + if (cfgQAFinal && cfgQAFlowStudy) { fillHistosFlow(qVec, tracks, cfgnMods->at(i)); } } From c04a4048e737fafed8365932336d42baa465510c Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Wed, 4 Sep 2024 11:57:07 +0200 Subject: [PATCH 11/60] ALICE 3: minimal sels for no MC assoc added (#7516) * ALICE 3: minimal sels for no MC assoc added * Move to THxDs for extra large numbers from OTF * Please consider the following formatting changes (#338) --------- Co-authored-by: ALICE Builder --- ALICE3/TableProducer/alice3-multicharm.cxx | 99 ++++++++++++++-------- 1 file changed, 63 insertions(+), 36 deletions(-) diff --git a/ALICE3/TableProducer/alice3-multicharm.cxx b/ALICE3/TableProducer/alice3-multicharm.cxx index 7b40e01cd20..6e69e32ae59 100644 --- a/ALICE3/TableProducer/alice3-multicharm.cxx +++ b/ALICE3/TableProducer/alice3-multicharm.cxx @@ -51,6 +51,7 @@ #include "ALICE3/DataModel/tracksAlice3.h" #include "DetectorsVertexing/PVertexer.h" #include "DetectorsVertexing/PVertexerHelpers.h" +#include "CommonConstants/PhysicsConstants.h" using namespace o2; using namespace o2::framework; @@ -77,19 +78,27 @@ struct alice3multicharm { Produces multiCharmCore; // Operation and minimisation criteria + Configurable fillDerivedTable{"fillDerivedTable", false, "fill MCharm[] tables (careful: memory)"}; Configurable magneticField{"magneticField", 20.0f, "Magnetic field (in kilogauss)"}; Configurable doDCAplots{"doDCAplots", true, "do daughter prong DCA plots for D mesons"}; Configurable mcSameMotherCheck{"mcSameMotherCheck", true, "check if tracks come from the same MC mother"}; - Configurable dcaXiCDaughtersSelection{"dcaXiCDaughtersSelection", 1000.0f, "DCA between XiC daughters (cm)"}; - Configurable dcaXiCCDaughtersSelection{"dcaXiCCDaughtersSelection", 1000.0f, "DCA between XiCC daughters (cm)"}; + Configurable dcaXiCDaughtersSelection{"dcaXiCDaughtersSelection", 200.0f, "DCA between XiC daughters (cm)"}; + Configurable dcaXiCCDaughtersSelection{"dcaXiCCDaughtersSelection", 200.0f, "DCA between XiCC daughters (cm)"}; - Configurable piFromXiC_dcaXYconstant{"piFromXiC_dcaXYconstant", -1.0f, "[0] in |DCAxy| > [0]+[1]/pT"}; + Configurable piFromXiC_dcaXYconstant{"piFromXiC_dcaXYconstant", 0.001f, "[0] in |DCAxy| > [0]+[1]/pT"}; Configurable piFromXiC_dcaXYpTdep{"piFromXiC_dcaXYpTdep", 0.0, "[1] in |DCAxy| > [0]+[1]/pT"}; - Configurable piFromXiCC_dcaXYconstant{"piFromXiCC_dcaXYconstant", -1.0f, "[0] in |DCAxy| > [0]+[1]/pT"}; + Configurable piFromXiCC_dcaXYconstant{"piFromXiCC_dcaXYconstant", 0.001f, "[0] in |DCAxy| > [0]+[1]/pT"}; Configurable piFromXiCC_dcaXYpTdep{"piFromXiCC_dcaXYpTdep", 0.0, "[1] in |DCAxy| > [0]+[1]/pT"}; - Configurable xiFromXiC_dcaXYconstant{"xiFromXiC_dcaXYconstant", -1.0f, "[0] in |DCAxy| > [0]+[1]/pT"}; + Configurable xiFromXiC_dcaXYconstant{"xiFromXiC_dcaXYconstant", 0.001f, "[0] in |DCAxy| > [0]+[1]/pT"}; Configurable xiFromXiC_dcaXYpTdep{"xiFromXiC_dcaXYpTdep", 0.0, "[1] in |DCAxy| > [0]+[1]/pT"}; + Configurable minPiCPt{"minPiCPt", 0.15, "Minimum pT for XiC pions"}; + Configurable minPiCCPt{"minPiCCPt", 0.3, "Minimum pT for XiCC pions"}; + + Configurable minXiCRadius{"minXiCRadius", 0.001, "Minimum R2D for XiC decay (cm)"}; + Configurable massWindowXi{"massWindowXi", 0.015, "Mass window around Xi peak"}; + Configurable massWindowXiC{"massWindowXiC", 0.015, "Mass window around XiC peak"}; + ConfigurableAxis axisEta{"axisEta", {80, -4.0f, +4.0f}, "#eta"}; 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 QA histograms"}; ConfigurableAxis axisDCA{"axisDCA", {200, -100, 100}, "DCA (#mum)"}; @@ -118,9 +127,9 @@ struct alice3multicharm { // partitions for Xi daughters Partition tracksPiFromXiC = - ((aod::a3DecayMap::decayMap & trackSelectionPiFromXiC) == trackSelectionPiFromXiC) && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > piFromXiC_dcaXYconstant + piFromXiC_dcaXYpTdep* nabs(aod::track::signed1Pt); + ((aod::a3DecayMap::decayMap & trackSelectionPiFromXiC) == trackSelectionPiFromXiC) && aod::track::signed1Pt > 0.0f && 1.0f / nabs(aod::track::signed1Pt) > minPiCPt&& nabs(aod::track::dcaXY) > piFromXiC_dcaXYconstant + piFromXiC_dcaXYpTdep* nabs(aod::track::signed1Pt); Partition tracksPiFromXiCC = - ((aod::a3DecayMap::decayMap & trackSelectionPiFromXiCC) == trackSelectionPiFromXiCC) && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > piFromXiCC_dcaXYconstant + piFromXiCC_dcaXYpTdep* nabs(aod::track::signed1Pt); + ((aod::a3DecayMap::decayMap & trackSelectionPiFromXiCC) == trackSelectionPiFromXiCC) && aod::track::signed1Pt > 0.0f && 1.0f / nabs(aod::track::signed1Pt) > minPiCCPt&& nabs(aod::track::dcaXY) > piFromXiCC_dcaXYconstant + piFromXiCC_dcaXYpTdep* nabs(aod::track::signed1Pt); // Helper struct to pass candidate information struct { @@ -336,33 +345,33 @@ struct alice3multicharm { // failure rates. // --- 0: attempt XiC, 1: success XiC // --- 2: attempt XiCC, 3: success XiCC - histos.add("hCharmBuilding", "hCharmBuilding", kTH1F, {{10, -0.5, 9.5f}}); + histos.add("hCharmBuilding", "hCharmBuilding", kTH1D, {{10, -0.5, 9.5f}}); - histos.add("h2dGenXi", "h2dGenXi", kTH2F, {axisPt, axisEta}); - histos.add("h2dGenXiC", "h2dGenXiC", kTH2F, {axisPt, axisEta}); - histos.add("h2dGenXiCC", "h2dGenXiCC", kTH2F, {axisPt, axisEta}); + histos.add("h2dGenXi", "h2dGenXi", kTH1D, {axisPt, axisEta}); + histos.add("h2dGenXiC", "h2dGenXiC", kTH1D, {axisPt, axisEta}); + histos.add("h2dGenXiCC", "h2dGenXiCC", kTH1D, {axisPt, axisEta}); - histos.add("hMassXi", "hMassXi", kTH1F, {axisXiMass}); - histos.add("hMassXiC", "hMassXiC", kTH1F, {axisXiCMass}); - histos.add("hMassXiCC", "hMassXiCC", kTH1F, {axisXiCCMass}); + histos.add("hMassXi", "hMassXi", kTH1D, {axisXiMass}); + histos.add("hMassXiC", "hMassXiC", kTH1D, {axisXiCMass}); + histos.add("hMassXiCC", "hMassXiCC", kTH1D, {axisXiCCMass}); - histos.add("hEtaXiCC", "hEtaXiCC", kTH1F, {axisEta}); - histos.add("hPtXiCC", "hPtXiCC", kTH1F, {axisPt}); - histos.add("h3dMassXiCC", "h3dMassXiCC", kTH3F, {axisPt, axisEta, axisXiCCMass}); + histos.add("hEtaXiCC", "hEtaXiCC", kTH1D, {axisEta}); + histos.add("hPtXiCC", "hPtXiCC", kTH1D, {axisPt}); + histos.add("h3dMassXiCC", "h3dMassXiCC", kTH3D, {axisPt, axisEta, axisXiCCMass}); - histos.add("hDCAXiCDaughters", "hDCAXiCDaughters", kTH1F, {axisDCAXiCDaughters}); - histos.add("hDCAXiCCDaughters", "hDCAXiCCDaughters", kTH1F, {axisDCAXiCCDaughters}); + histos.add("hDCAXiCDaughters", "hDCAXiCDaughters", kTH1D, {axisDCAXiCDaughters}); + histos.add("hDCAXiCCDaughters", "hDCAXiCCDaughters", kTH1D, {axisDCAXiCCDaughters}); // These histograms bookkeep the exact number of combinations attempted // CombinationsXiC: triplets Xi-pi-pi considered per Xi // CombinationsXiCC: doublets XiC-pi considered per XiC - histos.add("hCombinationsXiC", "hCombinationsXiC", kTH1F, {axisNConsidered}); - histos.add("hCombinationsXiCC", "hCombinationsXiCC", kTH1F, {axisNConsidered}); + histos.add("hCombinationsXiC", "hCombinationsXiC", kTH1D, {axisNConsidered}); + histos.add("hCombinationsXiCC", "hCombinationsXiCC", kTH1D, {axisNConsidered}); if (doDCAplots) { - histos.add("h2dDCAxyVsPtXiFromXiC", "h2dDCAxyVsPtXiFromXiC", kTH2F, {axisPt, axisDCA}); - histos.add("h2dDCAxyVsPtPiFromXiC", "h2dDCAxyVsPtPiFromXiC", kTH2F, {axisPt, axisDCA}); - histos.add("h2dDCAxyVsPtPiFromXiCC", "h2dDCAxyVsPtPiFromXiCC", kTH2F, {axisPt, axisDCA}); + histos.add("h2dDCAxyVsPtXiFromXiC", "h2dDCAxyVsPtXiFromXiC", kTH2D, {axisPt, axisDCA}); + histos.add("h2dDCAxyVsPtPiFromXiC", "h2dDCAxyVsPtPiFromXiC", kTH2D, {axisPt, axisDCA}); + histos.add("h2dDCAxyVsPtPiFromXiCC", "h2dDCAxyVsPtPiFromXiCC", kTH2D, {axisPt, axisDCA}); } } @@ -404,6 +413,10 @@ struct alice3multicharm { for (auto const& xiCand : cascades) { histos.fill(HIST("hMassXi"), xiCand.mXi()); + + if (std::abs(xiCand.mXi() - o2::constants::physics::MassXiMinus) > massWindowXi) + continue; // out of mass region + uint32_t nCombinationsC = 0; auto xi = xiCand.cascadeTrack_as(); // de-reference cascade track auto piFromXi = xiCand.bachTrack_as(); // de-reference bach track @@ -418,6 +431,8 @@ struct alice3multicharm { continue; if (xiCand.posTrackId() == pi1c.globalIndex() || xiCand.negTrackId() == pi1c.globalIndex() || xiCand.bachTrackId() == pi1c.globalIndex()) continue; // avoid using any track that was already used + if (pi1c.pt() < minPiCPt) + continue; // second pion from XiC decay for starts here for (auto const& pi2c : tracksPiFromXiCgrouped) { @@ -428,6 +443,8 @@ struct alice3multicharm { continue; // avoid same-mother, avoid double-counting if (xiCand.posTrackId() == pi2c.globalIndex() || xiCand.negTrackId() == pi2c.globalIndex() || xiCand.bachTrackId() == pi2c.globalIndex()) continue; // avoid using any track that was already used + if (pi2c.pt() < minPiCPt) + continue; // if I am here, it means this is a triplet to be considered for XiC vertexing. // will now attempt to build a three-body decay candidate with these three track rows. @@ -436,6 +453,9 @@ struct alice3multicharm { histos.fill(HIST("hCharmBuilding"), 0.0f); if (!buildDecayCandidateThreeBody(xi, pi1c, pi2c, 1.32171, 0.139570, 0.139570)) continue; // failed at building candidate + + if (std::abs(thisXiCcandidate.mass - o2::constants::physics::MassXiCPlus) > massWindowXiC) + continue; // out of mass region histos.fill(HIST("hCharmBuilding"), 1.0f); const std::array momentumC = { @@ -445,6 +465,9 @@ struct alice3multicharm { o2::track::TrackParCov xicTrack(thisXiCcandidate.xyz, momentumC, thisXiCcandidate.parentTrackCovMatrix, +1); + if (std::hypot(thisXiCcandidate.xyz[0], thisXiCcandidate.xyz[1]) < minXiCRadius) + continue; // do not take if radius too small, likely a primary combination + o2::dataformats::DCA dcaInfo; float xicdcaXY = 1e+10, xicdcaZ = 1e+10; o2::track::TrackParCov xicTrackCopy(xicTrack); // paranoia @@ -466,6 +489,8 @@ struct alice3multicharm { if (xiCand.posTrackId() == picc.globalIndex() || xiCand.negTrackId() == picc.globalIndex() || xiCand.bachTrackId() == picc.globalIndex()) continue; // avoid using any track that was already used + if (picc.pt() < minPiCCPt) + continue; // to-do: check same mother here o2::track::TrackParCov piccTrack = getTrackParCov(picc); @@ -495,18 +520,20 @@ struct alice3multicharm { } // produce multi-charm table for posterior analysis - multiCharmCore( - thisXiCcandidate.dca, thisXiCCcandidate.dca, - thisXiCcandidate.mass, thisXiCCcandidate.mass, - thisXiCCcandidate.pt, thisXiCCcandidate.eta, - xi.nSiliconHits(), piFromXi.nSiliconHits(), - piFromLa.nSiliconHits(), prFromLa.nSiliconHits(), - pi1c.nSiliconHits(), pi2c.nSiliconHits(), picc.nSiliconHits(), - piFromXi.nTPCHits(), piFromLa.nTPCHits(), prFromLa.nTPCHits(), - pi1c.nTPCHits(), pi2c.nTPCHits(), picc.nTPCHits(), - xi.dcaXY(), xicdcaXY, xiccdcaXY, - piFromXi.dcaXY(), piFromLa.dcaXY(), prFromLa.dcaXY(), - pi1c.dcaXY(), pi2c.dcaXY(), picc.dcaXY()); + if (fillDerivedTable) { + multiCharmCore( + thisXiCcandidate.dca, thisXiCCcandidate.dca, + thisXiCcandidate.mass, thisXiCCcandidate.mass, + thisXiCCcandidate.pt, thisXiCCcandidate.eta, + xi.nSiliconHits(), piFromXi.nSiliconHits(), + piFromLa.nSiliconHits(), prFromLa.nSiliconHits(), + pi1c.nSiliconHits(), pi2c.nSiliconHits(), picc.nSiliconHits(), + piFromXi.nTPCHits(), piFromLa.nTPCHits(), prFromLa.nTPCHits(), + pi1c.nTPCHits(), pi2c.nTPCHits(), picc.nTPCHits(), + xi.dcaXY(), xicdcaXY, xiccdcaXY, + piFromXi.dcaXY(), piFromLa.dcaXY(), prFromLa.dcaXY(), + pi1c.dcaXY(), pi2c.dcaXY(), picc.dcaXY()); + } } histos.fill(HIST("hCombinationsXiCC"), nCombinationsCC); } From c2f6da8d480fe013effc53158b5f87bc63a2bfc9 Mon Sep 17 00:00:00 2001 From: yhambard <127940767+yhambard@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:25:24 +0400 Subject: [PATCH 12/60] [PWGEM] phosElId new histograms and fixes (#7541) --- PWGEM/Tasks/phosElId.cxx | 180 ++++++++++++++++++++++++++++----------- 1 file changed, 132 insertions(+), 48 deletions(-) diff --git a/PWGEM/Tasks/phosElId.cxx b/PWGEM/Tasks/phosElId.cxx index 2423992f953..327061dbfbc 100644 --- a/PWGEM/Tasks/phosElId.cxx +++ b/PWGEM/Tasks/phosElId.cxx @@ -101,21 +101,21 @@ struct phosElId { Configurable mEpmin{"mEpmin", -1., "Min for E/p histograms"}; Configurable mEpmax{"mEpmax", 3., "Max for E/p histograms"}; - Configurable> pSigma_dz{"pSigma_dz", {20., 0.76, 6.6, 3.6, 0.1}, "parameters for sigma dz function"}; - Configurable> pSigma_dx{"pSigma_dx", {3, 2.3, 3.1}, "parameters for sigma dx function"}; + Configurable> pSigma_dz{"pSigma_dz", {0.642, 0., 1.77, 2.725, 0.}, "parameters for sigma dz function"}; + Configurable> pSigma_dx{"pSigma_dx", {2.17769, 1.60275, 2.24136}, "parameters for sigma dx function"}; - Configurable> pPhosShiftZ{"pPhosShiftZ", {4.5, 3., 2., 2.}, "Phos coordinate centering Z per module"}; - Configurable> pPhosShiftX{"pPhosShiftX", {1.99, -0.63, -1.55, -1.63}, "Phos coordinate centering X per module"}; + Configurable> pPhosShiftZ{"pPhosShiftZ", {4.78838, 2.75138, 1.40825, 2.28735}, "Phos coordinate centering Z per module"}; + Configurable> pPhosShiftX{"pPhosShiftX", {2.158702, -1.526772, -0.814658, -1.852678}, "Phos coordinate centering X per module"}; - Configurable> pMean_dx_pos_mod1{"pMean_dx_pos_mod1", {-9.57, -0.47, 1.04}, "parameters for mean dx function on module 1 for positive tracks"}; - Configurable> pMean_dx_pos_mod2{"pMean_dx_pos_mod2", {-12.24, -0.18, 1.59}, "parameters for mean dx function on module 2 for positive tracks"}; - Configurable> pMean_dx_pos_mod3{"pMean_dx_pos_mod3", {-5.73, -0.58, 1.13}, "parameters for mean dx function on module 3 for positive tracks"}; - Configurable> pMean_dx_pos_mod4{"pMean_dx_pos_mod4", {-5.14, -0.67, 1.05}, "parameters for mean dx function on module 4 for positive tracks"}; + Configurable> pMean_dx_pos_mod1{"pMean_dx_pos_mod1", {-10.57, -0.42, 1.06}, "parameters for mean dx function on module 1 for positive tracks"}; + Configurable> pMean_dx_pos_mod2{"pMean_dx_pos_mod2", {-8.1, -0.42, 1.14}, "parameters for mean dx function on module 2 for positive tracks"}; + Configurable> pMean_dx_pos_mod3{"pMean_dx_pos_mod3", {-8.34, -0.42, 1.04}, "parameters for mean dx function on module 3 for positive tracks"}; + Configurable> pMean_dx_pos_mod4{"pMean_dx_pos_mod4", {-7.38, -0.42, 1.17}, "parameters for mean dx function on module 4 for positive tracks"}; - Configurable> pMean_dx_neg_mod1{"pMean_dx_neg_mod1", {10.29, -0.42, 1.12}, "parameters for mean dx function on module 1 for negative tracks"}; - Configurable> pMean_dx_neg_mod2{"pMean_dx_neg_mod2", {8.24, -0.42, 1.31}, "parameters for mean dx function on module 2 for negative tracks"}; - Configurable> pMean_dx_neg_mod3{"pMean_dx_neg_mod3", {11.83, -0.17, 1.71}, "parameters for mean dx function on module 3 for negative tracks"}; - Configurable> pMean_dx_neg_mod4{"pMean_dx_neg_mod4", {84.96, 0.79, 2.83}, "parameters for mean dx function on module 4 for negative tracks"}; + Configurable> pMean_dx_neg_mod1{"pMean_dx_neg_mod1", {9.92, -0.42, 1.29}, "parameters for mean dx function on module 1 for negative tracks"}; + Configurable> pMean_dx_neg_mod2{"pMean_dx_neg_mod2", {7.82, -0.4, 1.34}, "parameters for mean dx function on module 2 for negative tracks"}; + Configurable> pMean_dx_neg_mod3{"pMean_dx_neg_mod3", {8.45, -0.33, 1.5}, "parameters for mean dx function on module 3 for negative tracks"}; + Configurable> pMean_dx_neg_mod4{"pMean_dx_neg_mod4", {7.5, -0.42, 1.25}, "parameters for mean dx function on module 4 for negative tracks"}; Configurable cfgEtaMax{"cfgEtaMax", {0.8f}, "eta ranges"}; Configurable cfgPtMin{"cfgPtMin", {0.2f}, "pt min"}; @@ -248,18 +248,6 @@ struct phosElId { mHistManager.add("hCluE_ncells_mod", "Cluster energy spectrum per module", HistType::kTH3F, {axisE, axisCells, axisModes}); mHistManager.add("hCluXZ_mod", "Local cluster X Z per module", HistType::kTH3F, {axisX, axisZ, axisModes}); - mHistManager.add("hCluE_v_pt_disp", "Cluster energy vs p | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); - mHistManager.add("hCluE_v_pt_1sigma", "Cluster energy vs p within trackmatch 1sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); - mHistManager.add("hCluE_v_pt_1sigma_disp", "Cluster energy vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); - mHistManager.add("hCluE_v_pt_2sigma", "Cluster energy vs p within trackmatch 2sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); - mHistManager.add("hCluE_v_pt_2sigma_disp", "Cluster energy vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); - - mHistManager.add("hEp_v_pt_disp", "E/p ratio vs p | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); - mHistManager.add("hEp_v_pt_1sigma", "E/p ratio vs p within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); - mHistManager.add("hEp_v_pt_1sigma_disp", "E/p ratio vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); - mHistManager.add("hEp_v_pt_2sigma", "E/p ratio vs p within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); - mHistManager.add("hEp_v_pt_2sigma_disp", "E/p ratio vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); - mHistManager.add("hdZpmod", "dz,p_{tr},module", HistType::kTH3F, {axisdZ, axisPt, axisModes}); mHistManager.add("hdZpmod_pos", "dz,p_{tr},module positive tracks", HistType::kTH3F, {axisdZ, axisPt, axisModes}); mHistManager.add("hdZpmod_neg", "dz,p_{tr},module negative tracks", HistType::kTH3F, {axisdZ, axisPt, axisModes}); @@ -267,18 +255,42 @@ struct phosElId { mHistManager.add("hdXpmod_pos", "dx,p_{tr},module positive tracks", HistType::kTH3F, {axisdX, axisPt, axisModes}); mHistManager.add("hdXpmod_neg", "dx,p_{tr},module negative tracks", HistType::kTH3F, {axisdX, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_disp", "Cluster energy vs p | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_1sigma", "Cluster energy vs p within trackmatch 1sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_1sigma_disp", "Cluster energy vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_2sigma", "Cluster energy vs p within trackmatch 2sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_2sigma_disp", "Cluster energy vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hCluE_v_pt_disp_TPC", "Cluster energy vs p | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); mHistManager.add("hCluE_v_pt_1sigma_TPC", "Cluster energy vs p within trackmatch 1sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); mHistManager.add("hCluE_v_pt_1sigma_disp_TPC", "Cluster energy vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); mHistManager.add("hCluE_v_pt_2sigma_TPC", "Cluster energy vs p within trackmatch 2sigma", HistType::kTH3F, {axisE, axisPt, axisModes}); mHistManager.add("hCluE_v_pt_2sigma_disp_TPC", "Cluster energy vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisE, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_disp", "E/p ratio vs p | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_1sigma", "E/p ratio vs p within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_1sigma_disp", "E/p ratio vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_2sigma", "E/p ratio vs p within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_pt_2sigma_disp", "E/p ratio vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + + mHistManager.add("hEp_v_E_disp", "E/p ratio vs cluster E | OK dispersion", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_1sigma", "E/p ratio vs cluster E within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_1sigma_disp", "E/p ratio vs cluster E within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_2sigma", "E/p ratio vs cluster E within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_2sigma_disp", "E/p ratio vs cluster E within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_pt_disp_TPC", "E/p ratio vs p | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); mHistManager.add("hEp_v_pt_1sigma_TPC", "E/p ratio vs p within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); mHistManager.add("hEp_v_pt_1sigma_disp_TPC", "E/p ratio vs p within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); mHistManager.add("hEp_v_pt_2sigma_TPC", "E/p ratio vs p within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisPt, axisModes}); mHistManager.add("hEp_v_pt_2sigma_disp_TPC", "E/p ratio vs p within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisPt, axisModes}); + mHistManager.add("hEp_v_E_disp_TPC", "E/p ratio vs cluster E | OK dispersion", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_1sigma_TPC", "E/p ratio vs cluster E within trackmatch 1sigma", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_1sigma_disp_TPC", "E/p ratio vs cluster E within trackmatch 1sigma | OK dispersion", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_2sigma_TPC", "E/p ratio vs cluster E within trackmatch 2sigma", HistType::kTH3F, {axisEp, axisE, axisModes}); + mHistManager.add("hEp_v_E_2sigma_disp_TPC", "E/p ratio vs cluster E within trackmatch 2sigma | OK dispersion", HistType::kTH3F, {axisEp, axisE, axisModes}); + geomPHOS = std::make_unique("PHOS"); fSigma_dz = new TF1("fSigma_dz", "[0]/(x+[1])^[2]+pol1(3)", 0.3, 10); fSigma_dz->SetParameters(parameters_sigma_dz.at(0), parameters_sigma_dz.at(1), parameters_sigma_dz.at(2), parameters_sigma_dz.at(3), parameters_sigma_dz.at(4)); @@ -307,7 +319,7 @@ struct phosElId { } void process(soa::Join::iterator const& collision, aod::CaloClusters& clusters, - soa::Filtered& tracks, + soa::Filtered const& tracks, aod::BCsWithTimestamps const&) { auto bc = collision.bc_as(); @@ -415,41 +427,51 @@ struct phosElId { if (isDispOK) { mHistManager.fill(HIST("hCluE_v_pt_disp"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_disp"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_disp"), Ep, cluE, module); if (isElectron) { mHistManager.fill(HIST("hCluE_v_pt_disp_TPC"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_disp_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_disp_TPC"), Ep, cluE, module); } } if (!isWithin2Sigma(module, trackPT, dZ, dX)) continue; mHistManager.fill(HIST("hCluE_v_pt_2sigma"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_2sigma"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_2sigma"), Ep, cluE, module); if (isElectron) { mHistManager.fill(HIST("hCluE_v_pt_2sigma_TPC"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_2sigma_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_2sigma_TPC"), Ep, cluE, module); } if (isDispOK) { mHistManager.fill(HIST("hCluE_v_pt_2sigma_disp"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_2sigma_disp"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_2sigma_disp"), Ep, cluE, module); if (isElectron) { mHistManager.fill(HIST("hCluE_v_pt_2sigma_disp_TPC"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_2sigma_disp_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_2sigma_disp_TPC"), Ep, cluE, module); } phosMatch(collision.index(), clu.index(), track.index()); } if (isWithin1Sigma(module, trackPT, dZ, dX)) { mHistManager.fill(HIST("hCluE_v_pt_1sigma"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_1sigma"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_1sigma"), Ep, cluE, module); if (isElectron) { mHistManager.fill(HIST("hCluE_v_pt_1sigma_TPC"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_1sigma_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_1sigma_TPC"), Ep, cluE, module); } if (isDispOK) { mHistManager.fill(HIST("hCluE_v_pt_1sigma_disp"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_1sigma_disp"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_1sigma_disp"), Ep, cluE, module); if (isElectron) { mHistManager.fill(HIST("hCluE_v_pt_1sigma_disp_TPC"), cluE, trackPT, module); mHistManager.fill(HIST("hEp_v_pt_1sigma_disp_TPC"), Ep, trackPT, module); + mHistManager.fill(HIST("hEp_v_E_1sigma_disp_TPC"), Ep, cluE, module); } } } @@ -669,13 +691,26 @@ struct massSpectra { const AxisSpec axisCounter{1, 0, +1, ""}, axisPt{momentum_binning, "p_{T} (GeV/c)"}, + axisE{200, 0, 10, "E (GeV)", "E (GeV)"}, axisMassSpectrum{4000, 0, 4, "M (GeV/c^{2})", "Mass e^{+}e^{-} (GeV/c^{2})"}; mHistManager.add("eventCounter", "eventCounter", kTH1F, {axisCounter}); mHistManager.add("TVXinPHOSCounter", "TVXinPHOSCounter", kTH1F, {axisCounter}); - mHistManager.add("h_eh_mass_spectra", "Mass e^{#pm}h^{#mp} vs momentum e^{#pm}h^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisPt}); - mHistManager.add("h_ee_mass_spectra", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_eh_pp_mass_spectra_v_Pt", "Mass e^{+}h^{+} vs momentum e^{+}h^{+}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_ee_pp_mass_spectra_v_Pt", "Mass e^{+}e^{+} vs momentum e^{+}e^{+}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_eh_mm_mass_spectra_v_Pt", "Mass e^{-}h^{-} vs momentum e^{-}h^{-}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_ee_mm_mass_spectra_v_Pt", "Mass e^{-}e^{-} vs momentum e^{-}e^{-}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + + mHistManager.add("h_eh_pp_mass_spectra_v_E", "Mass e^{+}h^{+} vs cluster E e^{+}h^{+}", HistType::kTH2F, {axisMassSpectrum, axisE}); + mHistManager.add("h_ee_pp_mass_spectra_v_E", "Mass e^{+}e^{+} vs cluster E e^{+}e^{+}", HistType::kTH2F, {axisMassSpectrum, axisE}); + mHistManager.add("h_eh_mm_mass_spectra_v_E", "Mass e^{-}h^{-} vs cluster E e^{-}h^{-}", HistType::kTH2F, {axisMassSpectrum, axisE}); + mHistManager.add("h_ee_mm_mass_spectra_v_E", "Mass e^{-}e^{-} vs cluster E e^{-}e^{-}", HistType::kTH2F, {axisMassSpectrum, axisE}); + + mHistManager.add("h_eh_mp_mass_spectra_v_Pt", "Mass e^{#pm}h^{#mp} vs momentum e^{#pm}h^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_ee_mp_mass_spectra_v_Pt", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_eh_mp_mass_spectra_v_E", "Mass e^{#pm}h^{#mp} vs cluster E e^{#pm}h^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisE}); + mHistManager.add("h_ee_mp_mass_spectra_v_E", "Mass e^{#pm}e^{#mp} vs cluster E e^{#pm}e^{#mp}", HistType::kTH2F, {axisMassSpectrum, axisE}); geomPHOS = std::make_unique("PHOS"); @@ -756,18 +791,38 @@ struct massSpectra { if (TPCel.index() >= track2.index()) break; - if (TPCel.sign() == track2.sign()) - continue; - float mass_2tracks = 0, mom_2tracks = 0; + float mass_2tracks = 0, mom_2tracks = 0, cluE = clust2.e(); TLorentzVector P1, P2; P1.SetPxPyPzE(TPCel.px(), TPCel.py(), TPCel.pz(), TPCel.energy(0)); P2.SetPxPyPzE(track2.px(), track2.py(), track2.pz(), track2.energy(0)); mom_2tracks = (P1 + P2).Pt(); mass_2tracks = (P1 + P2).M(); - mHistManager.fill(HIST("h_eh_mass_spectra"), mass_2tracks, mom_2tracks); - - if (fabs(clust2.e() / track2.p() - 1) < 2 * fEp_sigma_phos->Eval(mom_2tracks)) { - mHistManager.fill(HIST("h_ee_mass_spectra"), mass_2tracks, mom_2tracks); + bool posTrack = (TPCel.sign() > 0 && bz > 0) || (TPCel.sign() < 0 && bz < 0); + bool elCandidate = (fabs(clust2.e() / track2.p() - 1) < 2 * fEp_sigma_phos->Eval(mom_2tracks)); + + if (TPCel.sign() == track2.sign()) { + if (posTrack) { + mHistManager.fill(HIST("h_eh_pp_mass_spectra_v_Pt"), mass_2tracks, mom_2tracks); + mHistManager.fill(HIST("h_eh_pp_mass_spectra_v_E"), mass_2tracks, cluE); + if (elCandidate) { + mHistManager.fill(HIST("h_ee_pp_mass_spectra_v_Pt"), mass_2tracks, mom_2tracks); + mHistManager.fill(HIST("h_ee_pp_mass_spectra_v_E"), mass_2tracks, cluE); + } + } else { + mHistManager.fill(HIST("h_eh_mm_mass_spectra_v_Pt"), mass_2tracks, mom_2tracks); + mHistManager.fill(HIST("h_eh_mm_mass_spectra_v_E"), mass_2tracks, cluE); + if (elCandidate) { + mHistManager.fill(HIST("h_ee_mm_mass_spectra_v_Pt"), mass_2tracks, mom_2tracks); + mHistManager.fill(HIST("h_ee_mm_mass_spectra_v_E"), mass_2tracks, cluE); + } + } + } else { + mHistManager.fill(HIST("h_eh_mp_mass_spectra_v_Pt"), mass_2tracks, mom_2tracks); + mHistManager.fill(HIST("h_eh_mp_mass_spectra_v_E"), mass_2tracks, cluE); + if (elCandidate) { + mHistManager.fill(HIST("h_ee_mp_mass_spectra_v_Pt"), mass_2tracks, mom_2tracks); + mHistManager.fill(HIST("h_ee_mp_mass_spectra_v_E"), mass_2tracks, cluE); + } } } } // end of double loop @@ -814,7 +869,8 @@ struct tpcElIdMassSpectrum { Filter tpcPr_rej = (aod::pidtpc::tpcNSigmaPr < cfgTPCNSigmaPrMin) || (aod::pidtpc::tpcNSigmaPr > cfgTPCNSigmaPrMax); Service ccdb; - std::unique_ptr geomPHOS; + double bz{0.}; // magnetic field + int runNumber{0}; HistogramRegistry mHistManager{"tpcElIdHistograms"}; @@ -843,9 +899,13 @@ struct tpcElIdMassSpectrum { mHistManager.add("h_TPCee_MS_mm", "Mass e^{-}e^{-} vs momentum e^{-}e^{-} (from TPC candidates) vs pair pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); mHistManager.add("h_TPCee_MS_pp", "Mass e^{+}e^{+} vs momentum e^{+}e^{+} (from TPC candidates) vs pair pt", HistType::kTH2F, {axisMassSpectrum, axisPt}); - mHistManager.add("h_TPCee_MS_mp_phosRange", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp} (from TPC candidates) vs pair pt with one e in phosRange", HistType::kTH2F, {axisMassSpectrum, axisPt}); - mHistManager.add("h_TPCee_MS_mm_phosRange", "Mass e^{-}e^{-} vs momentum e^{-}e^{-} (from TPC candidates) vs pair pt with one e in phosRange", HistType::kTH2F, {axisMassSpectrum, axisPt}); - mHistManager.add("h_TPCee_MS_pp_phosRange", "Mass e^{+}e^{+} vs momentum e^{+}e^{+} (from TPC candidates) vs pair pt with one e in phosRange", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_mp_phosRange", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp} (from TPC candidates) vs pair pt with one e in phos acceptance range", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_mm_phosRange", "Mass e^{-}e^{-} vs momentum e^{-}e^{-} (from TPC candidates) vs pair pt with one e in phos acceptance range", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_pp_phosRange", "Mass e^{+}e^{+} vs momentum e^{+}e^{+} (from TPC candidates) vs pair pt with one e in phos acceptance range", HistType::kTH2F, {axisMassSpectrum, axisPt}); + + mHistManager.add("h_TPCee_MS_mp_phosRange_kTVXinPHOS", "Mass e^{#pm}e^{#mp} vs momentum e^{#pm}e^{#mp} (from TPC candidates) vs pair pt with one e in phos acceptance range", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_mm_phosRange_kTVXinPHOS", "Mass e^{-}e^{-} vs momentum e^{-}e^{-} (from TPC candidates) vs pair pt with one e in phos acceptance range", HistType::kTH2F, {axisMassSpectrum, axisPt}); + mHistManager.add("h_TPCee_MS_pp_phosRange_kTVXinPHOS", "Mass e^{+}e^{+} vs momentum e^{+}e^{+} (from TPC candidates) vs pair pt with one e in phos acceptance range", HistType::kTH2F, {axisMassSpectrum, axisPt}); mHistManager.add("hTrackVX", "Track vertex coordinate X", HistType::kTH1F, {axisVTrackX}); mHistManager.add("hTrackVY", "Track vertex coordinate Y", HistType::kTH1F, {axisVTrackY}); @@ -858,12 +918,23 @@ struct tpcElIdMassSpectrum { mHistManager.add("hTrackPt_Cut", "Track pt after cut", HistType::kTH1F, {axisPtBig}); mHistManager.add("hTrackEta", "Track eta", HistType::kTH1F, {axisEta}); mHistManager.add("hTrackEta_Cut", "Track eta after cut", HistType::kTH1F, {axisEta}); - - geomPHOS = std::make_unique("PHOS"); } void process(soa::Join::iterator const& collision, - soa::Filtered& tracks) + soa::Filtered const& tracks, + aod::BCsWithTimestamps const&) { + auto bc = collision.bc_as(); + if (runNumber != bc.runNumber()) { + LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; + o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", bc.timestamp()); + if (grpo == nullptr) { + LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); + } + o2::base::Propagator::initFieldFromGRP(grpo); + bz = o2::base::Propagator::Instance()->getNominalBz(); + LOG(info) << ">>>>>>>>>>>> Magnetic field: " << bz; + runNumber = bc.runNumber(); + } mHistManager.fill(HIST("eventCounter"), 0.5); if (fabs(collision.posZ()) > 10.f) return; @@ -898,23 +969,36 @@ struct tpcElIdMassSpectrum { P1.SetPxPyPzE(track1.px(), track1.py(), track1.pz(), track1.energy(0)); P2.SetPxPyPzE(track2.px(), track2.py(), track2.pz(), track2.energy(0)); - bool inPhosEtaRange = (fabs(track1.eta()) < 0.12 || fabs(track2.eta()) < 0.12); - bool inPhosPhiRange = (track1.phi() * TMath::RadToDeg() > 240 && track1.phi() * TMath::RadToDeg() < 310) || (track2.phi() * TMath::RadToDeg() > 240 && track2.phi() * TMath::RadToDeg() < 310); - bool inPhosRange = inPhosEtaRange && inPhosPhiRange; + bool inPhosEtaRange1 = fabs(track1.eta()) < 0.12; + bool inPhosEtaRange2 = fabs(track2.eta()) < 0.12; + bool inPhosPhiRange1 = (track1.phi() * TMath::RadToDeg() > 250 && track1.phi() * TMath::RadToDeg() < 320); + bool inPhosPhiRange2 = (track2.phi() * TMath::RadToDeg() > 250 && track2.phi() * TMath::RadToDeg() < 320); + bool inPhosRange = (inPhosEtaRange1 && inPhosPhiRange1) || (inPhosEtaRange2 && inPhosPhiRange2); + bool posTrack = (track1.sign() > 0 && bz > 0) || (track1.sign() < 0 && bz < 0); + if (track1.sign() == track2.sign()) { - if (track1.sign() > 0) { + if (posTrack) { mHistManager.fill(HIST("h_TPCee_MS_pp"), (P1 + P2).M(), (P1 + P2).Pt()); - if (inPhosRange) + if (inPhosRange) { mHistManager.fill(HIST("h_TPCee_MS_pp_phosRange"), (P1 + P2).M(), (P1 + P2).Pt()); + if (collision.alias_bit(kTVXinPHOS)) + mHistManager.fill(HIST("h_TPCee_MS_pp_phosRange_kTVXinPHOS"), (P1 + P2).M(), (P1 + P2).Pt()); + } } else { mHistManager.fill(HIST("h_TPCee_MS_mm"), (P1 + P2).M(), (P1 + P2).Pt()); - if (inPhosRange) + if (inPhosRange) { mHistManager.fill(HIST("h_TPCee_MS_mm_phosRange"), (P1 + P2).M(), (P1 + P2).Pt()); + if (collision.alias_bit(kTVXinPHOS)) + mHistManager.fill(HIST("h_TPCee_MS_mm_phosRange_kTVXinPHOS"), (P1 + P2).M(), (P1 + P2).Pt()); + } } } else { mHistManager.fill(HIST("h_TPCee_MS_mp"), (P1 + P2).M(), (P1 + P2).Pt()); - if (inPhosRange) + if (inPhosRange) { mHistManager.fill(HIST("h_TPCee_MS_mp_phosRange"), (P1 + P2).M(), (P1 + P2).Pt()); + if (collision.alias_bit(kTVXinPHOS)) + mHistManager.fill(HIST("h_TPCee_MS_mp_phosRange_kTVXinPHOS"), (P1 + P2).M(), (P1 + P2).Pt()); + } } } From f4a0be609e5110f7c288707798d923cc14e13f17 Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Wed, 4 Sep 2024 19:52:17 +0800 Subject: [PATCH 13/60] PWGCF: Recevice general GFW input from configurable (#7553) * rename axisCentrality, add option to use Multiplicity dependence * add GFW eta regions, add configurable to receive user defined GFW * clang formatted * clang format * add fatal signal --- PWGCF/Flow/Tasks/FlowTask.cxx | 79 ++++++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowTask.cxx b/PWGCF/Flow/Tasks/FlowTask.cxx index 35f227c8c63..2b9cd8e1be7 100644 --- a/PWGCF/Flow/Tasks/FlowTask.cxx +++ b/PWGCF/Flow/Tasks/FlowTask.cxx @@ -68,6 +68,8 @@ struct FlowTask { O2_DEFINE_CONFIGURABLE(cfgMagnetField, std::string, "GLO/Config/GRPMagField", "CCDB path to Magnet field object") O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 500, "High cut on TPC occupancy") O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy") + Configurable> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"}; + Configurable> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"}; ConfigurableAxis axisVertex{"axisVertex", {40, -20, 20}, "vertex axis for histograms"}; ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; @@ -75,7 +77,7 @@ struct FlowTask { ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; ConfigurableAxis axisPtHist{"axisPtHist", {100, 0., 10.}, "pt axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 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}, "pt axis for histograms"}; - ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; + ConfigurableAxis axisIndependent{"axisIndependent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "X axis for histograms"}; ConfigurableAxis axisCentForQA{"axisCentForQA", {100, 0, 100}, "centrality for QA"}; ConfigurableAxis axisNch{"axisNch", {4000, 0, 4000}, "N_{ch}"}; ConfigurableAxis axisT0C{"axisT0C", {70, 0, 70000}, "N_{ch} (T0C)"}; @@ -185,12 +187,12 @@ struct FlowTask { registry.add("hDCAxy", "DCAxy after cuts; DCAxy (cm); Pt", {HistType::kTH2D, {{50, -1, 1}, {50, 0, 10}}}); registry.add("hTrackCorrection2d", "Correlation table for number of tracks table; uncorrected track; corrected track", {HistType::kTH2D, {axisNch, axisNch}}); // additional Output histograms - registry.add("hMeanPt", "", {HistType::kTProfile, {axisCentrality}}); - registry.add("hMeanPtWithinGap08", "", {HistType::kTProfile, {axisCentrality}}); - registry.add("c22_gap08_Weff", "", {HistType::kTProfile, {axisCentrality}}); - registry.add("c22_gap08_trackMeanPt", "", {HistType::kTProfile, {axisCentrality}}); - registry.add("PtVariance_partA_WithinGap08", "", {HistType::kTProfile, {axisCentrality}}); - registry.add("PtVariance_partB_WithinGap08", "", {HistType::kTProfile, {axisCentrality}}); + registry.add("hMeanPt", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("hMeanPtWithinGap08", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("c22_gap08_Weff", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("c22_gap08_trackMeanPt", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("PtVariance_partA_WithinGap08", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("PtVariance_partB_WithinGap08", "", {HistType::kTProfile, {axisIndependent}}); // initial array BootstrapArray.resize(cfgNbootstrap); @@ -198,11 +200,11 @@ struct FlowTask { 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, {axisCentrality}}); - BootstrapArray[i][kC22_Gap08_Weff] = registry.add(Form("BootstrapContainer_%d/c22_gap08_Weff", i), "", {HistType::kTProfile, {axisCentrality}}); - BootstrapArray[i][kC22_Gap08_MeanPt] = registry.add(Form("BootstrapContainer_%d/c22_gap08_trackMeanPt", i), "", {HistType::kTProfile, {axisCentrality}}); - BootstrapArray[i][kPtVarParA_InGap08] = registry.add(Form("BootstrapContainer_%d/PtVariance_partA_WithinGap08", i), "", {HistType::kTProfile, {axisCentrality}}); - BootstrapArray[i][kPtVarParB_InGap08] = registry.add(Form("BootstrapContainer_%d/PtVariance_partB_WithinGap08", i), "", {HistType::kTProfile, {axisCentrality}}); + 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; @@ -250,13 +252,24 @@ 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 (int 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, axisCentrality, cfgNbootstrap); + fFC->Initialize(oba, axisIndependent, cfgNbootstrap); delete oba; // eta region fGFW->AddRegion("full", -0.8, 0.8, 1, 1); + fGFW->AddRegion("refN00", -0.8, 0., 1, 1); // gap0 negative region + fGFW->AddRegion("refP00", 0., 0.8, 1, 1); // gap0 positve region + fGFW->AddRegion("refN02", -0.8, -0.1, 1, 1); // gap2 negative region + fGFW->AddRegion("refP02", 0.1, 0.8, 1, 1); // gap2 positve region fGFW->AddRegion("refN04", -0.8, -0.2, 1, 1); // gap4 negative region fGFW->AddRegion("refP04", 0.2, 0.8, 1, 1); // gap4 positve region fGFW->AddRegion("refN06", -0.8, -0.3, 1, 1); // gap6 negative region @@ -265,8 +278,11 @@ struct FlowTask { fGFW->AddRegion("refP08", 0.4, 0.8, 1, 1); fGFW->AddRegion("refN10", -0.8, -0.5, 1, 1); fGFW->AddRegion("refP10", 0.5, 0.8, 1, 1); - fGFW->AddRegion("refP", 0.4, 0.8, 1, 1); + fGFW->AddRegion("refN12", -0.8, -0.6, 1, 1); + fGFW->AddRegion("refP12", 0.6, 0.8, 1, 1); fGFW->AddRegion("refN", -0.8, -0.4, 1, 1); + fGFW->AddRegion("refP", 0.4, 0.8, 1, 1); + fGFW->AddRegion("refM", -0.4, 0.4, 1, 1); fGFW->AddRegion("poiN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 2); fGFW->AddRegion("olN", -0.8, -0.4, 1, 4); @@ -302,6 +318,18 @@ 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()) { + LOGF(info, "User adding GFW CorrelatorConfig:"); + // attentaion: here we follow the index of cfgUserDefineGFWCorr + for (int 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)); + } + } fGFW->CreateRegions(); if (cfgUseAdditionalEventCut) { @@ -613,6 +641,9 @@ struct FlowTask { // magnet field dependence cut Magnetfield = getMagneticField(bc.timestamp()); } + float independent = cent; + if (cfgUseNch) + independent = static_cast(tracks.size()); for (auto& track : tracks) { if (track.tpcNClsFound() < cfgCutTPCclu) @@ -661,19 +692,19 @@ struct FlowTask { // Filling TProfile // MeanPt if (weffEvent > 1e-6) - registry.fill(HIST("hMeanPt"), cent, ptSum / weffEvent, weffEvent); + registry.fill(HIST("hMeanPt"), independent, ptSum / weffEvent, weffEvent); if (weffEvent_WithinGap08 > 1e-6) - registry.fill(HIST("hMeanPtWithinGap08"), cent, ptSum_Gap08 / weffEvent_WithinGap08, weffEvent_WithinGap08); + registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEvent_WithinGap08, weffEvent_WithinGap08); // 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"), cent); + FillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEvent_WithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), independent); // PtVariance if (WeffEvent_diff_WithGap08 > 1e-6) { - registry.fill(HIST("PtVariance_partA_WithinGap08"), cent, + registry.fill(HIST("PtVariance_partA_WithinGap08"), independent, (ptSum_Gap08 * ptSum_Gap08 - sum_ptSquare_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, WeffEvent_diff_WithGap08); - registry.fill(HIST("PtVariance_partB_WithinGap08"), cent, + registry.fill(HIST("PtVariance_partB_WithinGap08"), independent, (weffEvent_WithinGap08 * ptSum_Gap08 - sum_pt_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, WeffEvent_diff_WithGap08); } @@ -681,21 +712,21 @@ struct FlowTask { // Filling Bootstrap Samples int SampleIndex = static_cast(cfgNbootstrap * l_Random); if (weffEvent_WithinGap08 > 1e-6) - BootstrapArray[SampleIndex][kMeanPt_InGap08]->Fill(cent, ptSum_Gap08 / weffEvent_WithinGap08, weffEvent_WithinGap08); + 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], cent); + 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(cent, + 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(cent, + BootstrapArray[SampleIndex][kPtVarParB_InGap08]->Fill(independent, (weffEvent_WithinGap08 * ptSum_Gap08 - sum_pt_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, WeffEvent_diff_WithGap08); } // Filling Flow Container for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) { - FillFC(corrconfigs.at(l_ind), cent, l_Random); + FillFC(corrconfigs.at(l_ind), independent, l_Random); } } }; From 5996789205279fceae0b67db959a355048ca589d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Wed, 4 Sep 2024 15:03:05 +0200 Subject: [PATCH 14/60] [TOF] add chi2 cut to betaqa (#7554) --- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx index 27df487189b..df9e474b4fb 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx @@ -48,6 +48,7 @@ struct tofPidBetaQa { ConfigurableAxis tofBetaBins{"tofBetaBins", {4000, 0, 2.f}, "Binning in the TOF beta plot"}; ConfigurableAxis trackLengthBins{"trackLengthBins", {100, 0, 1000.f}, "Binning in track length plot"}; Configurable requireGoodMatchTracks{"requireGoodMatchTracks", false, "Require good match tracks"}; + Configurable mMaxTOFChi2{"maxTOFChi2", 3.f, "Maximum TOF Chi2"}; void init(o2::framework::InitContext&) { @@ -193,7 +194,7 @@ struct tofPidBetaQa { h->GetXaxis()->SetBinLabel(1, "Tracks read"); h->GetXaxis()->SetBinLabel(2, "hasTOF"); h->GetXaxis()->SetBinLabel(3, "isGlobalTrack"); - h->GetXaxis()->SetBinLabel(4, "goodTOFMatch"); + h->GetXaxis()->SetBinLabel(4, TString::Format("TOF chi2 < %.2f", mMaxTOFChi2.value)); } Filter eventFilter = (applyEvSel.node() == 0) || @@ -244,7 +245,7 @@ struct tofPidBetaQa { continue; } histos.fill(HIST("event/trackselection"), 3.f); - if (requireGoodMatchTracks.value && !track.goodTOFMatch()) { // Skipping tracks without good match + if (track.tofChi2() > mMaxTOFChi2) { // Skipping tracks with large Chi2 continue; } histos.fill(HIST("event/trackselection"), 4.f); From 189d9133ac0a8748aaecb012163070043cc43f78 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Wed, 4 Sep 2024 15:35:06 +0200 Subject: [PATCH 15/60] PWGHF: Update LcToPKPi tree creator (#7550) * Update treeCreatorLcToPKPi.cxx * Please consider the following formatting changes * Update treeCreatorLcToPKPi.cxx --------- Co-authored-by: ALICE Action Bot --- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index d9efc0202a7..f0c1c1503c2 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -244,15 +244,12 @@ DECLARE_SOA_TABLE(HfCandLcFullEvs, "AOD", "HFCANDLCFULLEV", full::MultZeqNTracksPV); DECLARE_SOA_TABLE(HfCandLcFullPs, "AOD", "HFCANDLCFULLP", - full::McCollisionId, full::Pt, full::Eta, full::Phi, full::Y, full::FlagMc, - full::OriginMcGen, - full::McParticleId); - + full::OriginMcGen); } // namespace o2::aod /// Writes the full information in an output TTree @@ -502,14 +499,12 @@ struct HfTreeCreatorLcToPKPi { for (const auto& particle : particles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { rowCandidateFullParticles( - particle.mcCollisionId(), particle.pt(), particle.eta(), particle.phi(), RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus), particle.flagMcMatchGen(), - particle.originMcGen(), - particle.globalIndex()); + particle.originMcGen()); } } } From 3505c6265a59668a878306e1abd7abc4b0523d1e Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:26:26 +0200 Subject: [PATCH 16/60] PWGHF: D0selector Mass Cut from Triggers (#7556) * PWGHF: Mass Cut from Triggers * restore empty line --- PWGHF/TableProducer/candidateSelectorD0.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PWGHF/TableProducer/candidateSelectorD0.cxx b/PWGHF/TableProducer/candidateSelectorD0.cxx index 3254d513237..47cf4da6968 100644 --- a/PWGHF/TableProducer/candidateSelectorD0.cxx +++ b/PWGHF/TableProducer/candidateSelectorD0.cxx @@ -72,6 +72,8 @@ struct HfCandidateSelectorD0 { Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_D0ToKPi.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"}; + // Mass Cut for trigger analysis + Configurable useTriggerMassCut{"useTriggerMassCut", false, "Flag to enable parametrize pT differential mass cut for triggered data"}; o2::analysis::HfMlResponseD0ToKPi hfMlResponse; std::vector outputMlD0 = {}; @@ -80,6 +82,7 @@ struct HfCandidateSelectorD0 { TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; HfHelper hfHelper; + HfTrigger2ProngCuts hfTriggerCuts; using TracksSel = soa::Join; @@ -209,10 +212,16 @@ struct HfCandidateSelectorD0 { if (std::abs(massD0 - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } + if (useTriggerMassCut && !isCandidateInMassRange(massD0, o2::constants::physics::MassD0, candidate.pt(), hfTriggerCuts)) { + return false; + } } else { if (std::abs(massD0bar - o2::constants::physics::MassD0) > cuts->get(pTBin, "m")) { return false; } + if (useTriggerMassCut && !isCandidateInMassRange(massD0bar, o2::constants::physics::MassD0, candidate.pt(), hfTriggerCuts)) { + return false; + } } // cut on daughter pT From d58a0b227795bc0f9370e197b26a809cfd6bb8be Mon Sep 17 00:00:00 2001 From: dajones2 <140733426+dajones2@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:11:40 +0100 Subject: [PATCH 17/60] PWGJE: Fixing particle level weights (#7560) * PWGJE: Adding pThat cuts to h+jet task * Syntax fix * PWGJE: Fixing particle level weights --- PWGJE/Tasks/jetHadronRecoil.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index 63b97424224..7d76b0e4288 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -457,12 +457,12 @@ struct hJetAnalysis { } PROCESS_SWITCH(hJetAnalysis, processMCP, "process MC particle level", false); - void processMCPWeighted(soa::Join::iterator const& collision, + void processMCPWeighted(JetMcCollision const& collision, soa::Filtered> const& jets, soa::Filtered> const& jetsWTA, JetParticles const& particles) { - fillMCPHistograms(jets, jetsWTA, particles, collision.mcCollision().weight()); + fillMCPHistograms(jets, jetsWTA, particles, collision.weight()); } PROCESS_SWITCH(hJetAnalysis, processMCPWeighted, "process MC particle level with event weights", false); From f1e75090863eeab4731212968c39bfab344d20f2 Mon Sep 17 00:00:00 2001 From: HANSEO PARK <53218370+hanseopark@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:24:03 +0200 Subject: [PATCH 18/60] PWGJE: divide task for tagging (#7561) --- PWGJE/Tasks/jettaggerhfQA.cxx | 58 ++++++++++++++++------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/PWGJE/Tasks/jettaggerhfQA.cxx b/PWGJE/Tasks/jettaggerhfQA.cxx index 9f7fa7d30ae..43794ae132e 100644 --- a/PWGJE/Tasks/jettaggerhfQA.cxx +++ b/PWGJE/Tasks/jettaggerhfQA.cxx @@ -36,7 +36,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -template +template struct JetTaggerHFQA { // task on/off configuration @@ -357,8 +357,6 @@ struct JetTaggerHFQA { using JetTagTracksData = soa::Join; using JetTagTracksMCD = soa::Join; - using JetTagTableMCDMCPMatched = soa::Join; - using JetTagTableMCPMCDMatched = soa::Join; std::function&, const std::vector&)> sortImp = [](const std::vector& a, const std::vector& b) { @@ -998,7 +996,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processTracksDca, "Fill inclusive tracks' imformation for data", false); - void processIPsData(soa::Filtered::iterator const& collision, JetTagTableData const& jets, JetTagTracksData const& jtracks) + void processIPsData(soa::Filtered::iterator const& collision, soa::Join const& jets, JetTagTracksData const& jtracks) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1015,7 +1013,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processIPsData, "Fill impact parameter imformation for data jets", false); - void processIPsMCD(soa::Filtered::iterator const& collision, JetTagTableMCD const& mcdjets, JetTagTracksMCD const& jtracks, JetParticles&) + void processIPsMCD(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, JetTagTracksMCD const& jtracks, JetParticles&) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1032,7 +1030,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processIPsMCD, "Fill impact parameter imformation for mcd jets", false); - void processIPsMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, JetTagTracksMCD const& jtracks, JetParticles&) + void processIPsMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, JetTagTracksMCD const& jtracks, JetParticles&) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1046,7 +1044,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processIPsMCDWeighted, "Fill impact parameter imformation for mcd jets", false); - void processIPsMCP(soa::Filtered const& collisions, JetTagTableMCP const& mcpjets, JetParticles&) + void processIPsMCP(soa::Join const& mcpjets, JetParticles&, JetMcCollisions const&, soa::Filtered const& collisions) { for (auto mcpjet : mcpjets) { if (!jetfindingutilities::isInEtaAcceptance(mcpjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -1059,15 +1057,15 @@ struct JetTaggerHFQA { auto collisionspermcpjet = collisions.sliceBy(CollisionsPerMCPCollision, mcpjet.mcCollisionId()); if (collisionspermcpjet.size() >= 1 && jetderiveddatautilities::selectCollision(collisionspermcpjet.begin(), eventSelection)) { fillHistogramIPsMCP(mcpjet); - } else { - fillHistogramIPsMCP(mcpjet); } + } else { + fillHistogramIPsMCP(mcpjet); } } } PROCESS_SWITCH(JetTaggerHFQA, processIPsMCP, "Fill impact parameter imformation for mcp jets", false); - void processIPsMCPWeighted(soa::Filtered const& collisions, soa::Join const& mcpjets, JetParticles&) + void processIPsMCPWeighted(soa::Filtered const& collisions, soa::Join const& mcpjets, JetParticles&) { for (auto mcpjet : mcpjets) { if (!jetfindingutilities::isInEtaAcceptance(mcpjet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -1088,7 +1086,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processIPsMCPWeighted, "Fill impact parameter imformation for mcp jets weighted", false); - void processIPsMCPMCDMatched(soa::Filtered>::iterator const& collision, JetTagTableMCDMCPMatched const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, JetTagTracksMCD const& jtracks, JetParticles& particles) + void processIPsMCPMCDMatched(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, JetTagTracksMCD const& jtracks, JetParticles& particles) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1106,7 +1104,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processIPsMCPMCDMatched, "Fill impact parameter imformation for mcp mcd matched jets", false); - void processIPsMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, JetTagTracksMCD const& jtracks, JetParticles& particles) + void processIPsMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, JetTagTracksMCD const& jtracks, JetParticles& particles) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1124,7 +1122,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processIPsMCPMCDMatchedWeighted, "Fill impact parameter imformation for mcp mcd matched jets", false); - void processJPData(soa::Filtered::iterator const& collision, JetTagTableData const& jets, JetTagTracksData const&) + void processJPData(soa::Filtered::iterator const& collision, soa::Join const& jets, JetTagTracksData const&) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1141,7 +1139,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processJPData, "Fill jet probability imformation for data jets", false); - void processJPMCD(soa::Filtered::iterator const& collision, JetTagTableMCD const& mcdjets, JetTagTracksMCD const&) + void processJPMCD(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, JetTagTracksMCD const&) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1158,7 +1156,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processJPMCD, "Fill jet probability imformation for mcd jets", false); - void processJPMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, JetTagTracksMCD const&) + void processJPMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, JetTagTracksMCD const&) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1175,7 +1173,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processJPMCDWeighted, "Fill jet probability imformation for mcd jets", false); - void processSV2ProngData(soa::Filtered::iterator const& collision, soa::Join const& jets, aod::DataSecondaryVertex2Prongs const& prongs) + void processSV2ProngData(soa::Filtered::iterator const& collision, soa::Join const& jets, aod::DataSecondaryVertex2Prongs const& prongs) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1192,7 +1190,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngData, "Fill 2prong imformation for data jets", false); - void processSV3ProngData(soa::Filtered::iterator const& collision, soa::Join const& jets, aod::DataSecondaryVertex3Prongs const& prongs) + void processSV3ProngData(soa::Filtered::iterator const& collision, soa::Join const& jets, aod::DataSecondaryVertex3Prongs const& prongs) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1209,7 +1207,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngData, "Fill 2prong imformation for data jets", false); - void processSV2ProngMCD(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex2Prongs const& prongs) + void processSV2ProngMCD(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex2Prongs const& prongs) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1226,7 +1224,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngMCD, "Fill 2prong imformation for mcd jets", false); - void processSV2ProngMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex2Prongs const& prongs) + void processSV2ProngMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex2Prongs const& prongs) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1243,7 +1241,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngMCDWeighted, "Fill 2prong imformation for mcd jets", false); - void processSV2ProngMCPMCDMatched(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex2Prongs const& prongs, JetParticles& particles) + void processSV2ProngMCPMCDMatched(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, aod::MCDSecondaryVertex2Prongs const& prongs, JetParticles& particles) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1261,7 +1259,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngMCPMCDMatched, "Fill 2prong imformation for mcd jets", false); - void processSV2ProngMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex2Prongs const& prongs, JetParticles& particles) + void processSV2ProngMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, aod::MCDSecondaryVertex2Prongs const& prongs, JetParticles& particles) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1279,7 +1277,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV2ProngMCPMCDMatchedWeighted, "Fill 2prong imformation for mcd jets", false); - void processSV3ProngMCD(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex3Prongs const& prongs) + void processSV3ProngMCD(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex3Prongs const& prongs) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1296,7 +1294,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngMCD, "Fill 3prong imformation for mcd jets", false); - void processSV3ProngMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex3Prongs const& prongs) + void processSV3ProngMCDWeighted(soa::Filtered::iterator const& collision, soa::Join const& mcdjets, aod::MCDSecondaryVertex3Prongs const& prongs) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1313,7 +1311,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngMCDWeighted, "Fill 3prong imformation for mcd jets", false); - void processSV3ProngMCPMCDMatched(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex3Prongs const& prongs, JetParticles& particles) + void processSV3ProngMCPMCDMatched(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, aod::MCDSecondaryVertex3Prongs const& prongs, JetParticles& particles) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1331,7 +1329,7 @@ struct JetTaggerHFQA { } PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngMCPMCDMatched, "Fill 3prong imformation for mcd jets", false); - void processSV3ProngMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, JetTagTableMCPMCDMatched const& mcpjets, aod::MCDSecondaryVertex3Prongs const& prongs, JetParticles& particles) + void processSV3ProngMCPMCDMatchedWeighted(soa::Filtered>::iterator const& collision, soa::Join const& mcdjets, soa::Join const& mcpjets, aod::MCDSecondaryVertex3Prongs const& prongs, JetParticles& particles) { if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { return; @@ -1350,13 +1348,11 @@ struct JetTaggerHFQA { PROCESS_SWITCH(JetTaggerHFQA, processSV3ProngMCPMCDMatchedWeighted, "Fill 3prong imformation for mcd jets", false); }; -using JetTaggerQAChargedDataJets = soa::Join; -using JetTaggerQAChargedMCDJets = soa::Join; -using JetTaggerQAChargedMCDMCPJets = soa::Join; -using JetTaggerQAChargedMCPJets = soa::Join; -using JetTaggerQAChargedMCPMCDJets = soa::Join; +using JetTaggerQAChargedDataJets = soa::Join; +using JetTaggerQAChargedMCDJets = soa::Join; +using JetTaggerQAChargedMCPJets = soa::Join; -using JetTaggerQACharged = JetTaggerHFQA; +using JetTaggerQACharged = JetTaggerHFQA; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 4ed329ebfa4ebf6e1ca5ec50e5470103d1505803 Mon Sep 17 00:00:00 2001 From: lucamicheletti93 <38209984+lucamicheletti93@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:32:44 +0200 Subject: [PATCH 19/60] [PWGDQ] Adding first version of mini tree (#7562) * Adding first version of mini tree * Fixing clang --------- Co-authored-by: Lucamicheletti93 --- PWGDQ/DataModel/ReducedInfoTables.h | 4 ++++ PWGDQ/Tasks/tableReader.cxx | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 47209e426a1..ba3add306c7 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -809,6 +809,9 @@ DECLARE_SOA_TABLE(DimuonsAll, "AOD", "RTDIMUONALL", //! reducedpair::VertexPz, reducedpair::SVertex); +DECLARE_SOA_TABLE(DileptonsMiniTree, "AOD", "RTDILEPTMTREE", //! + reducedpair::Mass, reducedpair::Pt, reducedpair::Eta, reducedpair::CentFT0C, reducedpair::Cos2DeltaPhi); + using Dielectron = Dielectrons::iterator; using StoredDielectron = StoredDielectrons::iterator; using Dimuon = Dimuons::iterator; @@ -819,6 +822,7 @@ using DileptonFlow = DileptonsFlow::iterator; using DileptonInfo = DileptonsInfo::iterator; using DielectronAll = DielectronsAll::iterator; using DimuonAll = DimuonsAll::iterator; +using DileptonMiniTree = DileptonsMiniTree::iterator; // Tables for using analysis-dilepton-track with analysis-asymmetric-pairing DECLARE_SOA_TABLE(Ditracks, "AOD", "RTDITRACK", //! diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index 572eb46f38f..34435873ff6 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -918,6 +918,7 @@ struct AnalysisSameEventPairing { Produces dimuonAllList; Produces dileptonFlowList; Produces dileptonInfoList; + Produces dileptonMiniTree; float mMagField = 0.0; o2::parameters::GRPMagField* grpmag = nullptr; o2::base::MatLayerCylSet* lut = nullptr; @@ -948,6 +949,13 @@ struct AnalysisSameEventPairing { Configurable fCollisionSystem{"syst", "pp", "Collision system, pp or PbPb"}; Configurable fCenterMassEnergy{"energy", 13600, "Center of mass energy in GeV"}; + // Configurables to create output tree (flat tables or minitree) + struct : ConfigurableGroup { + Configurable fConfigMiniTree{"useMiniTree.cfgMiniTree", false, "Produce a single flat table with minimal information for analysis"}; + Configurable fConfigMiniTreeMinMass{"useMiniTree.cfgMiniTreeMinMass", 2, "Min. mass cut for minitree"}; + Configurable fConfigMiniTreeMaxMass{"useMiniTree.cfgMiniTreeMaxMass", 5, "Max. mass cut for minitree"}; + } useMiniTree; + Service ccdb; Filter filterEventSelected = aod::dqanalysisflags::isEventSelected == 1; // NOTE: the barrel filter map contains decisions for both electrons and hadrons used in the correlation task @@ -1180,6 +1188,9 @@ struct AnalysisSameEventPairing { dielectronAllList.reserve(1); dimuonAllList.reserve(1); } + if (useMiniTree.fConfigMiniTree) { + dileptonMiniTree.reserve(1); + } if (fConfigMultDimuons.value) { @@ -1318,6 +1329,16 @@ struct AnalysisSameEventPairing { if (fConfigAmbiguousHist && !(t1.isAmbiguous() || t2.isAmbiguous())) { fHistMan->FillHistClass(Form("%s_unambiguous", histNames[iCut][0].Data()), VarManager::fgValues); } + if (useMiniTree.fConfigMiniTree) { + float dileptonMass = VarManager::fgValues[VarManager::kMass]; + if (dileptonMass > useMiniTree.fConfigMiniTreeMinMass && dileptonMass < useMiniTree.fConfigMiniTreeMaxMass) { + dileptonMiniTree(VarManager::fgValues[VarManager::kMass], + VarManager::fgValues[VarManager::kPt], + VarManager::fgValues[VarManager::kRap], + VarManager::fgValues[VarManager::kCentFT0C], + VarManager::fgValues[VarManager::kCos2DeltaPhi]); + } + } } else { if (t1.sign() > 0) { fHistMan->FillHistClass(histNames[iCut][1].Data(), VarManager::fgValues); From 3f92df785a6e7da3bd06032a90f5223cb5edf271 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Thu, 5 Sep 2024 02:14:43 +0200 Subject: [PATCH 20/60] Common: add bc2mult / mult2bc maps (#7563) * Common: add bc2mult / mult2bc maps * Please consider the following formatting changes (#339) * Add MC vtxZ * Please consider the following formatting changes (#340) --------- Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 12 +- .../TableProducer/multiplicityExtraTable.cxx | 234 ++++++++++-------- Common/TableProducer/multiplicityTable.cxx | 6 +- 3 files changed, 150 insertions(+), 102 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index f84169973d0..d34028467e2 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -51,6 +51,7 @@ DECLARE_SOA_COLUMN(MultMCFT0C, multMCFT0C, int); //! DECLARE_SOA_COLUMN(MultMCNParticlesEta10, multMCNParticlesEta10, int); //! DECLARE_SOA_COLUMN(MultMCNParticlesEta08, multMCNParticlesEta08, int); //! DECLARE_SOA_COLUMN(MultMCNParticlesEta05, multMCNParticlesEta05, int); //! +DECLARE_SOA_COLUMN(MultMCPVz, multMCPVz, float); //! // complementary / MultsExtra table DECLARE_SOA_COLUMN(MultPVTotalContributors, multPVTotalContributors, int); //! @@ -76,7 +77,8 @@ DECLARE_SOA_COLUMN(MultNGlobalTracksPV, multNGlobalTracksPV, int); DECLARE_SOA_COLUMN(MultNGlobalTracksPVeta1, multNGlobalTracksPVeta1, int); DECLARE_SOA_COLUMN(MultNGlobalTracksPVetaHalf, multNGlobalTracksPVetaHalf, int); -DECLARE_SOA_COLUMN(BCNumber, bcNumber, int); //! +DECLARE_SOA_INDEX_COLUMN(BC, bc); +DECLARE_SOA_INDEX_COLUMN(Collision, collision); // even further QA: timing information for neighboring events DECLARE_SOA_COLUMN(TimeToPrePrevious, timeToPrePrevious, float); //! @@ -111,12 +113,17 @@ using Mults = soa::Join; using Mult = Mults::iterator; // for QA purposes +DECLARE_SOA_TABLE(Mults2BC, "AOD", "MULTS2BC", //! Relate mult -> BC + o2::soa::Index<>, mult::BCId); +DECLARE_SOA_TABLE(BC2Mults, "AOD", "BC2MULTS", //! Relate BC -> mult + o2::soa::Index<>, mult::CollisionId); + DECLARE_SOA_TABLE(MultsExtra, "AOD", "MULTEXTRA", //! mult::MultPVTotalContributors, mult::MultPVChi2, mult::MultCollisionTimeRes, mult::MultRunNumber, mult::MultPVz, mult::MultSel8, mult::MultNTracksHasITS, mult::MultNTracksHasTPC, mult::MultNTracksHasTOF, mult::MultNTracksHasTRD, mult::MultNTracksITSOnly, mult::MultNTracksTPCOnly, mult::MultNTracksITSTPC, mult::MultAllTracksTPCOnly, mult::MultAllTracksITSTPC, - mult::BCNumber, evsel::NumTracksInTimeRange); + evsel::NumTracksInTimeRange); DECLARE_SOA_TABLE(MultNeighs, "AOD", "MULTNEIGH", //! mult::TimeToPrePrevious, mult::TimeToPrevious, @@ -137,6 +144,7 @@ DECLARE_SOA_TABLE(MultsExtraMC, "AOD", "MULTEXTRAMC", //! Table for the MC infor mult::MultMCNParticlesEta05, mult::MultMCNParticlesEta08, mult::MultMCNParticlesEta10, + mult::MultMCPVz, mult::IsInelGt0, mult::IsInelGt1, o2::soa::Marker<1>); diff --git a/Common/TableProducer/multiplicityExtraTable.cxx b/Common/TableProducer/multiplicityExtraTable.cxx index cc37a39e34b..a04cf79246d 100644 --- a/Common/TableProducer/multiplicityExtraTable.cxx +++ b/Common/TableProducer/multiplicityExtraTable.cxx @@ -33,6 +33,9 @@ struct MultiplicityExtraTable { Produces multBC; Produces multNeigh; + Produces mult2bc; + Produces bc2mult; + // Allow for downscaling of BC table for less space use in derived data Configurable bcDownscaleFactor{"bcDownscaleFactor", 2, "Downscale factor for BC table (0: save nothing, 1: save all)"}; Configurable minFT0CforBCTable{"minFT0CforBCTable", 25.0f, "Minimum FT0C amplitude to fill BC table to reduce data"}; @@ -59,117 +62,154 @@ struct MultiplicityExtraTable { using BCsWithRun3Matchings = soa::Join; - void processBCs(BCsWithRun3Matchings::iterator const& bc, aod::FV0As const&, aod::FT0s const&, aod::FDDs const&, aod::Zdcs const&) + void processBCs(BCsWithRun3Matchings const& bcs, aod::FV0As const&, aod::FT0s const&, aod::FDDs const&, aod::Zdcs const&, aod::Collisions const& collisions) { - // downscale if requested to do so - if (bcDownscaleFactor < 1.f && (static_cast(rand_r(&randomSeed)) / static_cast(RAND_MAX)) > bcDownscaleFactor) { - return; - } + //+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+ + // determine saved BCs and corresponding new BC table index + std::vector newBCindex(bcs.size()); + std::vector bc2multArray(bcs.size()); + int atIndex = 0; + for (const auto& bc : bcs) { + newBCindex[bc.globalIndex()] = -1; + bc2multArray[bc.globalIndex()] = -1; + + // downscale if requested to do so + if (bcDownscaleFactor < 1.f && (static_cast(rand_r(&randomSeed)) / static_cast(RAND_MAX)) > bcDownscaleFactor) { + continue; + } - bool Tvx = false; - bool isFV0OrA = false; - float multFT0C = 0.f; - float multFT0A = 0.f; - float multFV0A = 0.f; - float multFDDA = 0.f; - float multFDDC = 0.f; - - // ZDC amplitudes - float multZEM1 = -1.f; - float multZEM2 = -1.f; - float multZNA = -1.f; - float multZNC = -1.f; - float multZPA = -1.f; - float multZPC = -1.f; - - uint8_t multFT0TriggerBits = 0; - uint8_t multFV0TriggerBits = 0; - uint8_t multFDDTriggerBits = 0; - uint64_t multBCTriggerMask = bc.triggerMask(); - - // initialize - from Arvind - newRunNumber = bc.runNumber(); - int localBC = bc.globalBC() % nBCsPerOrbit; - - if (newRunNumber != oldRunNumber) { - auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, newRunNumber); - auto ts = soreor.first; - - LOG(info) << " newRunNumber " << newRunNumber << " time stamp " << ts; - oldRunNumber = newRunNumber; - auto grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); - CollidingBunch = grplhcif->getBunchFilling().getBCPattern(); - } // new run number - - bool collidingBC = CollidingBunch.test(localBC); - - if (bc.has_ft0()) { - auto ft0 = bc.ft0(); - std::bitset<8> triggers = ft0.triggerMask(); - Tvx = triggers[o2::fit::Triggers::bitVertex]; - multFT0TriggerBits = static_cast(triggers.to_ulong()); - - // calculate T0 charge - for (auto amplitude : ft0.amplitudeA()) { - multFT0A += amplitude; + float multFT0C = 0.f; + if (bc.has_ft0()) { + auto ft0 = bc.ft0(); + for (auto amplitude : ft0.amplitudeC()) { + multFT0C += amplitude; + } + } else { + multFT0C = -999.0f; } - for (auto amplitude : ft0.amplitudeC()) { - multFT0C += amplitude; + + if (multFT0C < minFT0CforBCTable) { + continue; // skip this event } - } else { - multFT0A = -999.0f; - multFT0C = -999.0f; + newBCindex[bc.globalIndex()] = atIndex++; } - if (bc.has_fv0a()) { - auto fv0 = bc.fv0a(); - std::bitset<8> fV0Triggers = fv0.triggerMask(); - multFV0TriggerBits = static_cast(fV0Triggers.to_ulong()); + //+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+ - for (auto amplitude : fv0.amplitude()) { - multFV0A += amplitude; - } - isFV0OrA = fV0Triggers[o2::fit::Triggers::bitA]; - } else { - multFV0A = -999.0f; + //+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+ + // interlink: collision -> valid BC, BC -> collision + for (const auto& collision : collisions) { + mult2bc(newBCindex[collision.bcId()]); + bc2multArray[collision.bcId()] = collision.globalIndex(); } + //+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+ - if (bc.has_fdd()) { - auto fdd = bc.fdd(); - std::bitset<8> fFDDTriggers = fdd.triggerMask(); - multFDDTriggerBits = static_cast(fFDDTriggers.to_ulong()); + for (const auto& bc : bcs) { + if (newBCindex[bc.globalIndex()] < 0) { + continue; // don't keep if low mult or downsampled out + } - for (auto amplitude : fdd.chargeA()) { - multFDDA += amplitude; + bool Tvx = false; + bool isFV0OrA = false; + float multFT0C = 0.f; + float multFT0A = 0.f; + float multFV0A = 0.f; + float multFDDA = 0.f; + float multFDDC = 0.f; + + // ZDC amplitudes + float multZEM1 = -1.f; + float multZEM2 = -1.f; + float multZNA = -1.f; + float multZNC = -1.f; + float multZPA = -1.f; + float multZPC = -1.f; + + uint8_t multFT0TriggerBits = 0; + uint8_t multFV0TriggerBits = 0; + uint8_t multFDDTriggerBits = 0; + uint64_t multBCTriggerMask = bc.triggerMask(); + + // initialize - from Arvind + newRunNumber = bc.runNumber(); + int localBC = bc.globalBC() % nBCsPerOrbit; + + if (newRunNumber != oldRunNumber) { + auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, newRunNumber); + auto ts = soreor.first; + + LOG(info) << " newRunNumber " << newRunNumber << " time stamp " << ts; + oldRunNumber = newRunNumber; + auto grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); + CollidingBunch = grplhcif->getBunchFilling().getBCPattern(); + } // new run number + + bool collidingBC = CollidingBunch.test(localBC); + + if (bc.has_ft0()) { + auto ft0 = bc.ft0(); + std::bitset<8> triggers = ft0.triggerMask(); + Tvx = triggers[o2::fit::Triggers::bitVertex]; + multFT0TriggerBits = static_cast(triggers.to_ulong()); + + // calculate T0 charge + for (auto amplitude : ft0.amplitudeA()) { + multFT0A += amplitude; + } + for (auto amplitude : ft0.amplitudeC()) { + multFT0C += amplitude; + } + } else { + multFT0A = -999.0f; + multFT0C = -999.0f; } - for (auto amplitude : fdd.chargeC()) { - multFDDC += amplitude; + if (bc.has_fv0a()) { + auto fv0 = bc.fv0a(); + std::bitset<8> fV0Triggers = fv0.triggerMask(); + multFV0TriggerBits = static_cast(fV0Triggers.to_ulong()); + + for (auto amplitude : fv0.amplitude()) { + multFV0A += amplitude; + } + isFV0OrA = fV0Triggers[o2::fit::Triggers::bitA]; + } else { + multFV0A = -999.0f; } - } else { - multFDDA = -999.0f; - multFDDC = -999.0f; - } - if (bc.has_zdc()) { - multZNA = bc.zdc().amplitudeZNA(); - multZNC = bc.zdc().amplitudeZNC(); - multZEM1 = bc.zdc().amplitudeZEM1(); - multZEM2 = bc.zdc().amplitudeZEM2(); - multZPA = bc.zdc().amplitudeZPA(); - multZPC = bc.zdc().amplitudeZPC(); - } else { - multZNA = -999.f; - multZNC = -999.f; - multZEM1 = -999.f; - multZEM2 = -999.f; - multZPA = -999.f; - multZPC = -999.f; - } + if (bc.has_fdd()) { + auto fdd = bc.fdd(); + std::bitset<8> fFDDTriggers = fdd.triggerMask(); + multFDDTriggerBits = static_cast(fFDDTriggers.to_ulong()); + + for (auto amplitude : fdd.chargeA()) { + multFDDA += amplitude; + } + for (auto amplitude : fdd.chargeC()) { + multFDDC += amplitude; + } + } else { + multFDDA = -999.0f; + multFDDC = -999.0f; + } - if (multFT0C < minFT0CforBCTable) { - return; // skip this event - } + if (bc.has_zdc()) { + multZNA = bc.zdc().amplitudeZNA(); + multZNC = bc.zdc().amplitudeZNC(); + multZEM1 = bc.zdc().amplitudeZEM1(); + multZEM2 = bc.zdc().amplitudeZEM2(); + multZPA = bc.zdc().amplitudeZPA(); + multZPC = bc.zdc().amplitudeZPC(); + } else { + multZNA = -999.f; + multZNC = -999.f; + multZEM1 = -999.f; + multZEM2 = -999.f; + multZPA = -999.f; + multZPC = -999.f; + } - multBC(multFT0A, multFT0C, multFV0A, multFDDA, multFDDC, multZNA, multZNC, multZEM1, multZEM2, multZPA, multZPC, Tvx, isFV0OrA, multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC); + bc2mult(bc2multArray[bc.globalIndex()]); + multBC(multFT0A, multFT0C, multFV0A, multFDDA, multFDDC, multZNA, multZNC, multZEM1, multZEM2, multZPA, multZPC, Tvx, isFV0OrA, multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC); + } } void processCollisionNeighbors(aod::Collisions const& collisions) diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 9ca40a47e19..f2e2c217def 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -567,7 +567,7 @@ struct MultiplicityTable { tableExtra(collision.numContrib(), collision.chi2(), collision.collisionTimeRes(), mRunNumber, collision.posZ(), collision.sel8(), nHasITS, nHasTPC, nHasTOF, nHasTRD, nITSonly, nTPConly, nITSTPC, - nAllTracksTPCOnly, nAllTracksITSTPC, bcNumber, collision.trackOccupancyInTimeRange()); + nAllTracksTPCOnly, nAllTracksITSTPC, collision.trackOccupancyInTimeRange()); } break; case kMultSelections: // Multiplicity selections { @@ -627,7 +627,7 @@ struct MultiplicityTable { Filter mcParticleFilter = (aod::mcparticle::eta < 4.9f) && (aod::mcparticle::eta > -3.3f); using mcParticlesFiltered = soa::Filtered; - void processMC(aod::McCollision const&, mcParticlesFiltered const& mcParticles) + void processMC(aod::McCollision const& mcCollision, mcParticlesFiltered const& mcParticles) { int multFT0A = 0; int multFT0C = 0; @@ -662,7 +662,7 @@ struct MultiplicityTable { if (3.5 < mcPart.eta() && mcPart.eta() < 4.9) multFT0A++; } - tableExtraMc(multFT0A, multFT0C, multBarrelEta05, multBarrelEta08, multBarrelEta10); + tableExtraMc(multFT0A, multFT0C, multBarrelEta05, multBarrelEta08, multBarrelEta10, mcCollision.posZ()); } Configurable min_pt_globaltrack{"min_pt_globaltrack", 0.15, "min. pT for global tracks"}; From 3a3e37d3fd486d8ffd89e9799d16c4d2b25144c2 Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska <87480906+zchochul@users.noreply.github.com> Date: Thu, 5 Sep 2024 03:26:15 +0200 Subject: [PATCH 21/60] PWGCF: FemtoUniverse -- Phi efficiency (#7567) * efficiency for Phi mesons * Phi efficiency * origin Phi in reco * recomcid --------- Co-authored-by: Zuzanna Chochulska --- .../femtoUniverseProducerTask.cxx | 2 +- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 46 ++++++++++++------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 760e76c88bb..38d2c6f4a97 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -1395,7 +1395,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()))) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index c9b2eb7bed3..56dc219c883 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -38,6 +38,7 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include #include +#include "CCDB/BasicCCDBManager.h" using namespace o2; using namespace o2::analysis::femtoUniverse; @@ -159,7 +160,8 @@ struct femtoUniversePairTaskTrackPhi { ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; // Efficiency - Configurable ConfLocalEfficiency{"ConfLocalEfficiency", "", "Local path to efficiency .root file"}; + Configurable ConfLocalEfficiencyProton{"ConfLocalEfficiencyProton", "", "Local path to proton efficiency th2d file"}; + Configurable ConfLocalEfficiencyPhi{"ConfLocalEfficiencyPhi", "", "Local path to Phi efficiency th2d file"}; FemtoUniverseAngularContainer sameEventAngularCont; FemtoUniverseAngularContainer mixedEventAngularCont; @@ -175,9 +177,9 @@ struct femtoUniversePairTaskTrackPhi { HistogramRegistry registryMCreco{"MCrecoHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry registryPhiMinvBackground{"registryPhiMinvBackground", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - std::unique_ptr plocalEffFile; - std::unique_ptr plocalEffp1; - std::unique_ptr plocalEffp2; + Service ccdb; + TH2D* protoneff; + TH2D* 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 @@ -423,15 +425,25 @@ struct femtoUniversePairTaskTrackPhi { pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value, ConfCPRInvMassCutMin.value, ConfCPRInvMassCutMax.value); } - 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()); - } + /// Initializing CCDB + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + + long now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + ccdb->setCreatedNotAfter(now); - plocalEffp1 = (ConfTrack.ConfTrackSign > 0) ? std::unique_ptr(plocalEffFile.get()->Get("PrPlus")) : std::unique_ptr(plocalEffFile.get()->Get("PrMinus")); - plocalEffp2 = std::unique_ptr(plocalEffFile.get()->Get("Phi")); - LOGF(info, "Loaded efficiency histograms for track-Phi."); + if (!ConfLocalEfficiencyProton.value.empty()) { + protoneff = ccdb->getForTimeStamp(ConfLocalEfficiencyProton.value.c_str(), -1); + if (!protoneff || protoneff->IsZombie()) { + LOGF(fatal, "Could not load efficiency protoneff histogram from %s", ConfLocalEfficiencyProton.value.c_str()); + } + } + if (!ConfLocalEfficiencyPhi.value.empty()) { + phieff = ccdb->getForTimeStamp(ConfLocalEfficiencyPhi.value.c_str(), -1); + if (!phieff || phieff->IsZombie()) { + LOGF(fatal, "Could not load efficiency phieff histogram from %s", ConfLocalEfficiencyPhi.value.c_str()); + } } vPIDPhiCandidate = ConfPhi.ConfPIDPhi.value; @@ -549,8 +561,8 @@ struct femtoUniversePairTaskTrackPhi { } float weight = 1.0f; - if (plocalEffp1) { - weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(track.pt(), track.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(phicandidate.pt(), phicandidate.eta())); + 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); } else { sameEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.ConfUse3D, weight); @@ -656,8 +668,8 @@ struct femtoUniversePairTaskTrackPhi { } float weight = 1.0f; - if (plocalEffp1) { - weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(track.pt(), track.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(phicandidate.pt(), phicandidate.eta())); + 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); } else { mixedEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.ConfUse3D, weight); @@ -775,7 +787,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::kFake)) { + if ((mcpart.pdgMCTruth() == 333) && (mcpart.partOriginMCTruth() == aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary)) { registryMCreco.fill(HIST("MCrecoPhi"), mcpart.pt(), mcpart.eta()); // phi } } else if (part.partType() == aod::femtouniverseparticle::ParticleType::kTrack) { From 11820e612a2a39be271bf705aae83038d9e1ad4d Mon Sep 17 00:00:00 2001 From: gvolpe79 <39517882+gvolpe79@users.noreply.github.com> Date: Thu, 5 Sep 2024 04:34:43 +0200 Subject: [PATCH 22/60] New HMP analysis task (#7565) * New HMP analysis task * minors --- DPG/Tasks/AOTTrack/PID/HMPID/CMakeLists.txt | 5 + .../AOTTrack/PID/HMPID/analysisHMPID.cxx | 131 ++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/CMakeLists.txt b/DPG/Tasks/AOTTrack/PID/HMPID/CMakeLists.txt index 9d153069976..763c9105528 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/CMakeLists.txt +++ b/DPG/Tasks/AOTTrack/PID/HMPID/CMakeLists.txt @@ -14,3 +14,8 @@ o2physics_add_dpl_workflow(pid-hmpid-qa SOURCES qaHMPID.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(pid-hmpid + SOURCES analysisHMPID.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx new file mode 100644 index 00000000000..00423aff287 --- /dev/null +++ b/DPG/Tasks/AOTTrack/PID/HMPID/analysisHMPID.cxx @@ -0,0 +1,131 @@ +// 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. + +// O2 includes +#include "ReconstructionDataFormats/Track.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "ReconstructionDataFormats/TrackParametrization.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/Core/PID/PIDTOF.h" +#include "Common/TableProducer/PID/pidTOFBase.h" +#include "ReconstructionDataFormats/PID.h" +#include "Common/Core/trackUtilities.h" +#include "ReconstructionDataFormats/DCA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/ASoA.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +namespace o2::aod +{ + +namespace variables_table // declaration of columns to create +{ +DECLARE_SOA_COLUMN(ChAngle, chAngle, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(Eta, eta, float); +DECLARE_SOA_COLUMN(MomentumHMPID, momentumHMPID, float); +DECLARE_SOA_COLUMN(MomentumTrack, momentumTrack, float); +DECLARE_SOA_COLUMN(Xtrack, xtrack, float); +DECLARE_SOA_COLUMN(Ytrack, ytrack, float); +DECLARE_SOA_COLUMN(Xmip, xmip, float); +DECLARE_SOA_COLUMN(Ymip, ymip, float); +DECLARE_SOA_COLUMN(Nphotons, nphotons, float); +DECLARE_SOA_COLUMN(ChargeMIP, chargeMIP, float); +DECLARE_SOA_COLUMN(ClusterSize, clustersize, float); +DECLARE_SOA_COLUMN(Chamber, chamber, float); +DECLARE_SOA_COLUMN(Photons_charge, photons_charge, float); + +DECLARE_SOA_COLUMN(EtaTrack, etatrack, float); +DECLARE_SOA_COLUMN(PhiTrack, phitrack, float); + +DECLARE_SOA_COLUMN(ITSNcluster, itsNcluster, float); +DECLARE_SOA_COLUMN(TPCNcluster, tpcNcluster, float); +DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, float); +DECLARE_SOA_COLUMN(TPCchi2, tpcChi2, float); +DECLARE_SOA_COLUMN(ITSchi2, itsChi2, float); + +DECLARE_SOA_COLUMN(DCAxy, dcaxy, float); +DECLARE_SOA_COLUMN(DCAz, dcaz, float); + +DECLARE_SOA_COLUMN(TPCNSigmaPi, tpcNsigmaPi, float); +DECLARE_SOA_COLUMN(TOFNSigmaPi, tofNsigmaPi, float); +DECLARE_SOA_COLUMN(TPCNSigmaKa, tpcNsigmaKa, float); +DECLARE_SOA_COLUMN(TOFNSigmaKa, tofNsigmaKa, float); +DECLARE_SOA_COLUMN(TPCNSigmaPr, tpcNsigmaPr, float); +DECLARE_SOA_COLUMN(TOFNSigmaPr, tofNsigmaPr, float); +DECLARE_SOA_COLUMN(TPCNSigmaDe, tpcNsigmaDe, float); +DECLARE_SOA_COLUMN(TOFNSigmaDe, tofNsigmaDe, float); + +} // namespace variables_table + +DECLARE_SOA_TABLE(HMPID_analysis, "AOD", "HMPIDANALYSIS", + variables_table::ChAngle, variables_table::Phi, variables_table::Eta, variables_table::MomentumHMPID, + variables_table::MomentumTrack, variables_table::Xtrack, variables_table::Ytrack, variables_table::Xmip, + variables_table::Ymip, variables_table::Nphotons, variables_table::ChargeMIP, variables_table::ClusterSize, + variables_table::Chamber, variables_table::Photons_charge, variables_table::EtaTrack, variables_table::PhiTrack, + variables_table::ITSNcluster, variables_table::TPCNcluster, variables_table::TPCNClsCrossedRows, + variables_table::TPCchi2, variables_table::ITSchi2, variables_table::DCAxy, variables_table::DCAz, + variables_table::TPCNSigmaPi, variables_table::TOFNSigmaPi, variables_table::TPCNSigmaKa, variables_table::TOFNSigmaKa, + variables_table::TPCNSigmaPr, variables_table::TOFNSigmaPr, variables_table::TPCNSigmaDe, variables_table::TOFNSigmaDe); +} // namespace o2::aod + +struct pidHmpidAnalysis { + + Produces HMPID_analysis; + + // using TrackCandidates = soa::Join; + + using CollisionCandidates = o2::soa::Join; + + using TrackCandidates = soa::Join; + + void process(const aod::HMPIDs& hmpids, + TrackCandidates const&, + CollisionCandidates const&) + { + + for (const auto& t : hmpids) { + if (t.track_as().isGlobalTrack() != (uint8_t) true) { + continue; + } + + const auto& track = t.track_as(); + + if (!track.hasITS() || !track.hasTPC() || !track.hasTOF()) { + continue; + } + + /////FILL TABLE + HMPID_analysis(t.hmpidSignal(), t.track_as().phi(), t.track_as().eta(), t.hmpidMom(), + track.p(), t.hmpidXTrack(), t.hmpidYTrack(), t.hmpidXMip(), + t.hmpidYMip(), t.hmpidNPhotons(), t.hmpidQMip(), (t.hmpidClusSize() % 1000000) / 1000, t.hmpidClusSize() / 1000000, + *t.hmpidPhotsCharge(), track.eta(), track.phi(), track.itsNCls(), track.tpcNClsFound(), track.tpcNClsCrossedRows(), + track.tpcChi2NCl(), track.itsChi2NCl(), track.dcaXY(), track.dcaZ(), + track.tpcNSigmaPi(), track.tofNSigmaPi(), track.tpcNSigmaKa(), track.tofNSigmaKa(), + track.tpcNSigmaPr(), track.tofNSigmaPr(), track.tpcNSigmaDe(), track.tofNSigmaDe()); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfg) { return WorkflowSpec{adaptAnalysisTask(cfg)}; } From 34425ba2a2c27aa21a5f8663632e30f6c62b2d59 Mon Sep 17 00:00:00 2001 From: Hadi Hassan Date: Thu, 5 Sep 2024 07:14:38 +0300 Subject: [PATCH 23/60] Adding a try catch to the SV reconstruction task (#7568) --- PWGJE/TableProducer/secondaryVertexReconstruction.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PWGJE/TableProducer/secondaryVertexReconstruction.cxx b/PWGJE/TableProducer/secondaryVertexReconstruction.cxx index 1a6536354a4..1474aafa873 100644 --- a/PWGJE/TableProducer/secondaryVertexReconstruction.cxx +++ b/PWGJE/TableProducer/secondaryVertexReconstruction.cxx @@ -163,7 +163,12 @@ struct SecondaryVertexReconstruction { // Reconstruct the secondary vertex int processResult = 0; - std::apply([&df, &processResult](const auto&... elems) { processResult = df.process(elems...); }, trackParVars); + try { + std::apply([&df, &processResult](const auto&... elems) { processResult = df.process(elems...); }, trackParVars); + } catch (const std::runtime_error& error) { + LOG(info) << "Run time error found: " << error.what() << ". DCAFitterN cannot work, skipping the candidate."; + return; + } if (processResult == 0) { return; } From a9dab96a3ab282d558c911fd115de962ad563678 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:30:13 +0200 Subject: [PATCH 24/60] PWGCF / FemtoUniverse : Fixing the bug in limits of mult. and kT (#7569) --- .../Core/FemtoUniversePairSHCentMultKt.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h index 9d3c60bea79..c6978f7c6eb 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h @@ -189,13 +189,13 @@ class PairSHCentMultKt 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 (ktval <= CentMultBins[4]) { + } else if (ktval < CentMultBins[4]) { multbinval = 3; } else { return; @@ -216,13 +216,13 @@ class PairSHCentMultKt int maxl, int multval, float ktval) { 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; From 51874d1c46b308d68f671236775e7de106f618be Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:51:32 +0200 Subject: [PATCH 25/60] missing include in D0 selector (#7570) --- PWGHF/TableProducer/candidateSelectorD0.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/TableProducer/candidateSelectorD0.cxx b/PWGHF/TableProducer/candidateSelectorD0.cxx index 47cf4da6968..46a8a747d74 100644 --- a/PWGHF/TableProducer/candidateSelectorD0.cxx +++ b/PWGHF/TableProducer/candidateSelectorD0.cxx @@ -26,6 +26,7 @@ #include "PWGHF/Core/HfMlResponseD0ToKPi.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" using namespace o2; using namespace o2::analysis; From 551c0561d8fa06ec6096a5fc1ab21c19da9f87c5 Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:34:22 +0200 Subject: [PATCH 26/60] PWGHF: DpH Corr check Gen Flag (#7557) * PWGHF: DpH check Gen Flag * Using TESTBIT * name of boolean changed --- .../TableProducer/correlatorDplusHadrons.cxx | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index aef44ea068d..9098a419895 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -404,7 +404,7 @@ struct HfCorrelatorDplusHadrons { // MC reco level bool isDplusPrompt = false; bool isDplusNonPrompt = false; - bool flagDplusSignal = false; + bool isDplusSignal = false; for (const auto& candidate : candidates) { // rapidity and pT selections if (std::abs(hfHelper.yDplus(candidate)) >= yCandMax || candidate.pt() <= ptCandMin || candidate.pt() >= ptCandMax) { @@ -417,7 +417,7 @@ struct HfCorrelatorDplusHadrons { efficiencyWeightD = 1. / efficiencyD->at(effBinD); } // Dplus flag - flagDplusSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; + isDplusSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::DplusToPiKPi); // prompt and non-prompt division isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; @@ -428,7 +428,7 @@ struct HfCorrelatorDplusHadrons { registry.fill(HIST("hMassDplusMcRec"), hfHelper.invMassDplusToPiKPi(candidate), efficiencyWeightD); registry.fill(HIST("hDplusBin"), poolBin); - if (flagDplusSignal) { + if (isDplusSignal) { // fill per-candidate distributions from Dplus true candidates registry.fill(HIST("hPtProng0MCRec"), candidate.ptProng0()); registry.fill(HIST("hPtProng1MCRec"), candidate.ptProng1()); @@ -479,7 +479,7 @@ struct HfCorrelatorDplusHadrons { track.eta() - candidate.eta(), candidate.pt(), track.pt(), poolBin); - entryDplusHadronRecoInfo(hfHelper.invMassDplusToPiKPi(candidate), flagDplusSignal); + entryDplusHadronRecoInfo(hfHelper.invMassDplusToPiKPi(candidate), isDplusSignal); entryDplusHadronMlInfo(outputMl[0], outputMl[1]); if (track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); @@ -517,12 +517,16 @@ struct HfCorrelatorDplusHadrons { registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); bool isDplusPrompt = false; + bool isDplusNonPrompt = false; // MC gen level for (const auto& particle1 : mcParticles) { // check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; } + if (!TESTBIT(std::abs(particle1.flagMcMatchGen()), aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + continue; + } double yD = RecoDecay::y(particle1.pVector(), MassDPlus); if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) { continue; @@ -535,9 +539,10 @@ struct HfCorrelatorDplusHadrons { // prompt and non-prompt division isDplusPrompt = particle1.originMcGen() == RecoDecay::OriginType::Prompt; + isDplusNonPrompt = particle1.originMcGen() == RecoDecay::OriginType::NonPrompt; if (isDplusPrompt) { registry.fill(HIST("hPtCandMcGenPrompt"), particle1.pt()); - } else { + } else if (isDplusNonPrompt) { registry.fill(HIST("hPtCandMcGenNonPrompt"), particle1.pt()); } @@ -583,7 +588,7 @@ struct HfCorrelatorDplusHadrons { entryDplusHadronRecoInfo(MassDPlus, true); entryDplusHadronGenInfo(isDplusPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin); } // end associated loop - } // end trigger + } // end trigger registry.fill(HIST("hcountDplusHadronPerEvent"), counterDplusHadron); registry.fill(HIST("hZvtx"), mcCollision.posZ()); // registry.fill(HIST("hMultiplicity"), getTracksSize(mcCollision)); @@ -623,11 +628,11 @@ struct HfCorrelatorDplusHadrons { continue; } // Dplus flag - bool flagDplusSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; + bool isDplusSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::DplusToPiKPi); // prompt and non-prompt division bool isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; bool isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; - if (flagDplusSignal) { + if (isDplusSignal) { if (isDplusPrompt) { registry.fill(HIST("hPtCandMcRecSigPrompt"), candidate.pt()); registry.fill(HIST("hPtVsMultiplicityMcRecPrompt"), candidate.pt(), 0); @@ -661,7 +666,7 @@ struct HfCorrelatorDplusHadrons { std::vector outputMl = {-1., -1., -1.}; bool isPhysicalPrimary = false; int trackOrigin = -1; - bool flagDplusSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; + bool isDplusSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; // prompt and non-prompt division bool isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; if (pAssoc.has_mcParticle()) { @@ -676,7 +681,7 @@ struct HfCorrelatorDplusHadrons { candidate.pt(), pAssoc.pt(), poolBin); - entryDplusHadronRecoInfo(hfHelper.invMassDplusToPiKPi(candidate), flagDplusSignal); + entryDplusHadronRecoInfo(hfHelper.invMassDplusToPiKPi(candidate), isDplusSignal); entryDplusHadronGenInfo(isDplusPrompt, isPhysicalPrimary, trackOrigin); for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; From 1e6597dce43d7d34ca6e8b51890b7dfcf905cb3a Mon Sep 17 00:00:00 2001 From: Jesper Gumprecht <113693781+jesgum@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:17:28 +0200 Subject: [PATCH 27/60] ALICE 3: Add missing same mother check for XiCC (#7564) * Add same mother check * Please consider the following formatting changes * Please consider the following formatting changes --------- Co-authored-by: ALICE Action Bot --- ALICE3/TableProducer/alice3-multicharm.cxx | 42 ++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/ALICE3/TableProducer/alice3-multicharm.cxx b/ALICE3/TableProducer/alice3-multicharm.cxx index 6e69e32ae59..f695224b7c5 100644 --- a/ALICE3/TableProducer/alice3-multicharm.cxx +++ b/ALICE3/TableProducer/alice3-multicharm.cxx @@ -316,6 +316,33 @@ struct alice3multicharm { return returnValue; } + // Association check for the XiCC pion + template + bool checkSameMotherExtra(TTrackType1 const& track1, TTrackType2 const& track2) + { + bool returnValue = false; + // This might perhaps be a bit excessive + // Could be joined with `checkSameMother` but leaving as is for now + if (track1.has_mcParticle() && track2.has_mcParticle()) { + auto mcParticle1 = track1.template mcParticle_as(); + auto mcParticle2 = track2.template mcParticle_as(); + if (mcParticle1.has_mothers() && mcParticle2.has_mothers()) { + for (auto& mcParticleMother1 : mcParticle1.template mothers_as()) { + if (mcParticleMother1.has_mothers()) { + for (auto& mcParticleGrandMother1 : mcParticleMother1.template mothers_as()) { + for (auto& mcParticleMother2 : mcParticle2.template mothers_as()) { + if (mcParticleGrandMother1.globalIndex() == mcParticleMother2.globalIndex()) { + returnValue = true; + } + } + } + } + } + } + } // end association check + return returnValue; + } + void init(InitContext&) { // initialize O2 2-prong fitter (only once) @@ -347,9 +374,9 @@ struct alice3multicharm { // --- 2: attempt XiCC, 3: success XiCC histos.add("hCharmBuilding", "hCharmBuilding", kTH1D, {{10, -0.5, 9.5f}}); - histos.add("h2dGenXi", "h2dGenXi", kTH1D, {axisPt, axisEta}); - histos.add("h2dGenXiC", "h2dGenXiC", kTH1D, {axisPt, axisEta}); - histos.add("h2dGenXiCC", "h2dGenXiCC", kTH1D, {axisPt, axisEta}); + histos.add("h2dGenXi", "h2dGenXi", kTH2D, {axisPt, axisEta}); + histos.add("h2dGenXiC", "h2dGenXiC", kTH2D, {axisPt, axisEta}); + histos.add("h2dGenXiCC", "h2dGenXiCC", kTH2D, {axisPt, axisEta}); histos.add("hMassXi", "hMassXi", kTH1D, {axisXiMass}); histos.add("hMassXiC", "hMassXiC", kTH1D, {axisXiCMass}); @@ -357,6 +384,7 @@ struct alice3multicharm { histos.add("hEtaXiCC", "hEtaXiCC", kTH1D, {axisEta}); histos.add("hPtXiCC", "hPtXiCC", kTH1D, {axisPt}); + histos.add("hMcPtXiCC", "hMcPtXiCC", kTH1D, {axisPt}); histos.add("h3dMassXiCC", "h3dMassXiCC", kTH3D, {axisPt, axisEta, axisXiCCMass}); histos.add("hDCAXiCDaughters", "hDCAXiCDaughters", kTH1D, {axisDCAXiCDaughters}); @@ -382,8 +410,10 @@ struct alice3multicharm { histos.fill(HIST("h2dGenXi"), mcParticle.pt(), mcParticle.eta()); for (auto const& mcParticle : trueXiC) histos.fill(HIST("h2dGenXiC"), mcParticle.pt(), mcParticle.eta()); - for (auto const& mcParticle : trueXiCC) + for (auto const& mcParticle : trueXiCC) { histos.fill(HIST("h2dGenXiCC"), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hMcPtXiCC"), mcParticle.pt()); + } } //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* @@ -491,8 +521,8 @@ struct alice3multicharm { continue; // avoid using any track that was already used if (picc.pt() < minPiCCPt) continue; - - // to-do: check same mother here + if (mcSameMotherCheck && !checkSameMotherExtra(xi, picc)) + continue; o2::track::TrackParCov piccTrack = getTrackParCov(picc); nCombinationsCC++; histos.fill(HIST("hCharmBuilding"), 2.0f); From ebfc9008717a30e6d8b27b0a31de61c3845aef3d Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Thu, 5 Sep 2024 11:56:26 +0200 Subject: [PATCH 28/60] PWGHF: improve pK0S channel in track index skim creator (#7571) * PWGHF: improve pK0S channel in track index skim creator * Fix typo --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 102 ++++++++---------- 1 file changed, 47 insertions(+), 55 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 6ade0108040..2377b72633a 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -2962,10 +2962,8 @@ struct HfTrackIndexSkimCreatorCascades { struct : ConfigurableGroup { Configurable isRun2{"isRun2", false, "enable Run 2 or Run 3 GRP objects for magnetic field"}; Configurable fillHistograms{"fillHistograms", true, "fill histograms"}; - // event selection - // Configurable triggerindex{"triggerindex", -1, "trigger index"}; // vertexing - // Configurable bz{"bz", 5., "magnetic field"}; + Configurable useDCAFitter{"useDCAFitter", true, "flag to optionally turn on/off the vertex reconstruction with the DCAFitter"}; Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; Configurable maxR{"maxR", 200., "reject PCA's above this radius"}; Configurable maxDZIni{"maxDZIni", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; @@ -2975,18 +2973,12 @@ struct HfTrackIndexSkimCreatorCascades { Configurable useWeightedFinalPCA{"useWeightedFinalPCA", true, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; // quality cut Configurable doCutQuality{"doCutQuality", true, "apply quality cuts"}; - // track cuts for bachelor - Configurable tpcRefitBach{"tpcRefitBach", true, "request TPC refit bachelor"}; - Configurable nCrossedRowsMinBach{"nCrossedRowsMinBach", 50, "min crossed rows bachelor"}; // track cuts for V0 daughters Configurable tpcRefitV0Daugh{"tpcRefitV0Daugh", true, "request TPC refit V0 daughters"}; Configurable nCrossedRowsMinV0Daugh{"nCrossedRowsMinV0Daugh", 50, "min crossed rows V0 daughters"}; Configurable etaMinV0Daugh{"etaMinV0Daugh", -99999., "min. pseudorapidity V0 daughters"}; Configurable etaMaxV0Daugh{"etaMaxV0Daugh", 1.1, "max. pseudorapidity V0 daughters"}; Configurable ptMinV0Daugh{"ptMinV0Daugh", 0.05, "min. pT V0 daughters"}; - // bachelor cuts - // Configurable dcabachtopv{"dcabachtopv", .1, "DCA Bach To PV"}; - // Configurable ptminbach{"ptminbach", -1., "min. track pT bachelor"}; // v0 cuts Configurable cpaV0Min{"cpaV0Min", .995, "min. cos PA V0"}; // as in the task that create the V0s Configurable dcaXYNegToPvMin{"dcaXYNegToPvMin", .1, "min. DCA_XY Neg To PV"}; // check: in HF Run 2, it was 0 at filtering @@ -2994,6 +2986,9 @@ struct HfTrackIndexSkimCreatorCascades { Configurable cutInvMassV0{"cutInvMassV0", 0.05, "V0 candidate invariant mass difference wrt PDG"}; // cascade cuts Configurable ptCascCandMin{"ptCascCandMin", -1., "min. pT of the cascade candidate"}; // PbPb 2018: use 1 + Configurable massPrK0sMin{"massPrK0sMin", 0.f, "Invariant mass lower limit for p K0S decay channel"}; + Configurable massPrK0sMax{"massPrK0sMax", 1000.f, "Invariant mass upper limit for p K0S decay channel"}; + Configurable cutInvMassCascLc{"cutInvMassCascLc", 1., "Lc candidate invariant mass difference wrt PDG"}; // for PbPb 2018: use 0.2 // Configurable cutCascDCADaughters{"cutCascDCADaughters", .1, "DCA between V0 and bachelor in cascade"}; // proton PID @@ -3015,7 +3010,6 @@ struct HfTrackIndexSkimCreatorCascades { double massP{0.}; double massK0s{0.}; - double massPi{0.}; double massLc{0.}; using SelectedCollisions = soa::Filtered>; @@ -3042,17 +3036,17 @@ struct HfTrackIndexSkimCreatorCascades { massP = o2::constants::physics::MassProton; massK0s = o2::constants::physics::MassK0Short; - massPi = o2::constants::physics::MassPiPlus; massLc = o2::constants::physics::MassLambdaCPlus; - df2.setPropagateToPCA(config.propagateToPCA); - df2.setMaxR(config.maxR); - df2.setMinParamChange(config.minParamChange); - df2.setMinRelChi2Change(config.minRelChi2Change); - // df2.setMaxDZIni(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs - // df2.setMaxChi2(1e9); // used in cascadeproducer.cxx, but not for the 2 prongs - df2.setUseAbsDCA(config.useAbsDCA); - df2.setWeightedFinalPCA(config.useWeightedFinalPCA); + if (config.useDCAFitter) { + df2.setPropagateToPCA(config.propagateToPCA); + df2.setMaxR(config.maxR); + df2.setMinParamChange(config.minParamChange); + df2.setMinRelChi2Change(config.minRelChi2Change); + df2.setMaxDZIni(config.maxDZIni); + df2.setUseAbsDCA(config.useAbsDCA); + df2.setWeightedFinalPCA(config.useWeightedFinalPCA); + } ccdb->setURL(config.ccdbUrl); ccdb->setCaching(true); @@ -3082,34 +3076,26 @@ struct HfTrackIndexSkimCreatorCascades { { // set the magnetic field from CCDB for (const auto& collision : collisions) { - auto bc = collision.bc_as(); - initCCDB(bc, runNumber, ccdb, config.isRun2 ? config.ccdbPathGrp : config.ccdbPathGrpMag, lut, config.isRun2); - df2.setBz(o2::base::Propagator::Instance()->getNominalBz()); - - // fist we loop over the bachelor candidate + if (config.useDCAFitter) { + auto bc = collision.bc_as(); + initCCDB(bc, runNumber, ccdb, config.isRun2 ? config.ccdbPathGrp : config.ccdbPathGrpMag, lut, config.isRun2); + df2.setBz(o2::base::Propagator::Instance()->getNominalBz()); + } const auto thisCollId = collision.globalIndex(); auto groupedBachTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); - // for (const auto& bach : selectedTracks) { + // fist we loop over the bachelor candidate for (const auto& bachIdx : groupedBachTrackIndices) { auto bach = bachIdx.track_as(); - - // selections on the bachelor - - // pT cut - // FIXME: this should go in the tag-sel-tracks - if (config.tpcRefitBach) { - if (!(bach.trackType() & o2::aod::track::TPCrefit)) { - continue; - } - } - if (bach.tpcNClsCrossedRows() < config.nCrossedRowsMinBach) { - continue; - } - + std::array pVecBach{bach.pVector()}; auto trackBach = getTrackParCov(bach); + if (thisCollId != bach.collisionId()) { // this is not the "default" collision for this track, we have to re-propagate it + o2::gpu::gpustd::array dcaInfoBach{bach.dcaXY(), bach.dcaZ()}; + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackBach, 2.f, noMatCorr, &dcaInfoBach); + getPxPyPz(trackBach, pVecBach); + } auto groupedV0s = v0s.sliceBy(v0sPerCollision, thisCollId); // now we loop over the V0s @@ -3171,27 +3157,28 @@ struct HfTrackIndexSkimCreatorCascades { trackParCovV0DaughPos.propagateTo(v0.posX(), o2::base::Propagator::Instance()->getNominalBz()); // propagate the track to the X closest to the V0 vertex auto trackParCovV0DaughNeg = getTrackParCov(trackV0DaughNeg); trackParCovV0DaughNeg.propagateTo(v0.negX(), o2::base::Propagator::Instance()->getNominalBz()); // propagate the track to the X closest to the V0 vertex - std::array pVecV0 = {0., 0., 0.}; - std::array pVecBach = {0., 0., 0.}; + std::array pVecV0 = {v0.px(), v0.py(), v0.pz()}; const std::array vertexV0 = {v0.x(), v0.y(), v0.z()}; // we build the neutral track to then build the cascade auto trackV0 = o2::dataformats::V0(vertexV0, momentumV0, {0, 0, 0, 0, 0, 0}, trackParCovV0DaughPos, trackParCovV0DaughNeg); // build the V0 track // now we find the DCA between the V0 and the bachelor, for the cascade - int nCand2 = 0; - try { - nCand2 = df2.process(trackV0, trackBach); - } catch (...) { - continue; - } + if (config.useDCAFitter) { + int nCand2 = 0; + try { + nCand2 = df2.process(trackV0, trackBach); + } catch (...) { + continue; + } - if (nCand2 == 0) { - continue; + if (nCand2 == 0) { + continue; + } + df2.propagateTracksToVertex(); // propagate the bach and V0 to the Lc vertex + df2.getTrack(0).getPxPyPzGlo(pVecV0); // take the momentum at the Lc vertex + df2.getTrack(1).getPxPyPzGlo(pVecBach); } - df2.propagateTracksToVertex(); // propagate the bach and V0 to the Lc vertex - df2.getTrack(0).getPxPyPzGlo(pVecV0); // take the momentum at the Lc vertex - df2.getTrack(1).getPxPyPzGlo(pVecBach); // cascade candidate pT cut auto ptCascCand = RecoDecay::pt(pVecBach, pVecV0); @@ -3202,11 +3189,16 @@ struct HfTrackIndexSkimCreatorCascades { // invariant mass // re-calculate invariant masses with updated momenta, to fill the histogram mass2K0sP = RecoDecay::m(std::array{pVecBach, pVecV0}, std::array{massP, massK0s}); + if (mass2K0sP < config.massPrK0sMin || mass2K0sP > config.massPrK0sMax) { + continue; + } std::array posCasc = {0., 0., 0.}; - const auto& cascVtx = df2.getPCACandidate(); - for (int i = 0; i < 3; i++) { - posCasc[i] = cascVtx[i]; + if (config.useDCAFitter) { + const auto& cascVtx = df2.getPCACandidate(); + for (int iCoord{0}; iCoord < 3; ++iCoord) { + posCasc[iCoord] = cascVtx[iCoord]; + } } // fill table row From b627395340ece547e420103f089300419cffa39b Mon Sep 17 00:00:00 2001 From: eloviyo <38348689+Eloviyo@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:16:09 +0200 Subject: [PATCH 29/60] initialized processTrackMCGen and added global filter to mc tracks for v0 analysis (#7572) Co-authored-by: Shirajum Monira --- .../TableProducer/femtoUniverseProducerTask.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 38d2c6f4a97..0bd9b95b771 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -432,10 +432,10 @@ struct femtoUniverseProducerTask { void init(InitContext&) { - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessTrackV0CentRun3) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTruthAndFullMC || doprocessFullMCCent) == false) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessTrackV0CentRun3) == 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 || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessTrackV0CentRun3) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { LOGF(fatal, "Cannot enable process Data and process MC at the same time. " "Please choose one."); @@ -1680,7 +1680,7 @@ struct femtoUniverseProducerTask { aod::McCollisions const& mccols, aod::McParticles const& mcParticles, soa::Join const& collisions, - soa::Join const& tracks, + soa::Filtered> const& tracks, soa::Join const& fullV0s, aod::BCsWithTimestamps const&) { From d4abd4276f0b4f255f4efccb4152eff60dd5d43b Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Thu, 5 Sep 2024 13:25:50 +0200 Subject: [PATCH 30/60] PWGLF: h-str cross-check / debug histo for closure (#7573) * PWGLF: h-str cross-check / debug histo for closure * Please consider the following formatting changes (#7574) --------- Co-authored-by: ALICE Builder --- PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 32d7a19d5f0..5070e2b03f9 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -726,6 +726,8 @@ struct correlateStrangeness { histos.add("hTriggerPrimaryEtaVsPt", "hTriggerPrimaryEtaVsPt", kTH3F, {axisPtQA, axisEta, axisMult}); histos.add("hTriggerAllSelectedEtaVsPt", "hTriggerAllSelectedEtaVsPt", kTH3F, {axisPtQA, axisEta, axisMult}); + histos.add("hClosureTestEventCounter", "hClosureTestEventCounter", kTH1F, {{10, 0, 10}}); + histos.add("hNumberOfRejectedPairsV0", "hNumberOfRejectedPairsV0", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsCascades", "hNumberOfRejectedPairsCascades", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsPions", "hNumberOfRejectedPairsPions", kTH1F, {{1, 0, 1}}); @@ -1168,8 +1170,9 @@ struct correlateStrangeness { } } - void processMCGenerated(aod::McCollision const&, 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); for (auto const& mcParticle : mcParticles) { if (!mcParticle.isPhysicalPrimary()) @@ -1245,6 +1248,8 @@ struct correlateStrangeness { if (!bestCollisionINELgtZERO) return; + histos.fill(HIST("hClosureTestEventCounter"), 3.5f); + for (auto const& mcParticle : mcParticles) { if (!mcParticle.isPhysicalPrimary()) { continue; @@ -1290,7 +1295,7 @@ struct correlateStrangeness { } } } - void processClosureTest(aod::McCollision const& collision, 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; @@ -1304,6 +1309,8 @@ struct correlateStrangeness { std::vector omegaMinusIndices; std::vector omegaPlusIndices; + histos.fill(HIST("hClosureTestEventCounter"), 0.5f); + int bestCollisionFT0Mpercentile = -1; float bestCollisionVtxZ = 0.0f; bool bestCollisionSel8 = false; @@ -1330,6 +1337,8 @@ struct correlateStrangeness { } } + histos.fill(HIST("hClosureTestEventCounter"), 1.5f); + int iteratorNum = -1; for (auto const& mcParticle : mcParticles) { iteratorNum = iteratorNum + 1; @@ -1416,7 +1425,7 @@ struct correlateStrangeness { continue; if (ptassoc < axisRanges[2][0] || ptassoc > axisRanges[2][1]) continue; - histos.fill(HIST("ClosureTest/sameEvent/") + HIST(particlenames[index]), ComputeDeltaPhi(gphitrigger, gphiassoc), getatrigger - getaassoc, ptassoc, pttrigger, collision.posZ(), bestCollisionFT0Mpercentile); + histos.fill(HIST("ClosureTest/sameEvent/") + HIST(particlenames[index]), ComputeDeltaPhi(gphitrigger, gphiassoc), getatrigger - getaassoc, ptassoc, pttrigger, bestCollisionVtxZ, bestCollisionFT0Mpercentile); } } }); From 9e8431d04243e00956225bc15ccd721f3d6f142f Mon Sep 17 00:00:00 2001 From: nzardosh Date: Thu, 5 Sep 2024 15:43:51 +0200 Subject: [PATCH 31/60] PWGJE: Simplyfing the background subtraction tables (#7576) --- PWGJE/DataModel/JetSubtraction.h | 17 +++---- .../eventwiseConstituentSubtractor.cxx | 34 ++++++------- PWGJE/TableProducer/rhoEstimator.cxx | 22 +++++++-- PWGJE/Tasks/jetfinderhfQA.cxx | 49 +++++++------------ 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/PWGJE/DataModel/JetSubtraction.h b/PWGJE/DataModel/JetSubtraction.h index 639049ea81a..f789d18637a 100644 --- a/PWGJE/DataModel/JetSubtraction.h +++ b/PWGJE/DataModel/JetSubtraction.h @@ -63,33 +63,32 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Dielectrons, "_0"); DECLARE_SOA_TABLE(BkgChargedRhos, "AOD", "BkgCRho", o2::soa::Index<>, - bkgcharged::JCollisionId, bkgrho::Rho, bkgrho::RhoM); DECLARE_SOA_TABLE(BkgD0Rhos, "AOD", "BkgD0Rho", o2::soa::Index<>, - bkgd0::CandidateId, bkgrho::Rho, - bkgrho::RhoM); + bkgrho::RhoM, + o2::soa::Marker<1>); DECLARE_SOA_TABLE(BkgLcRhos, "AOD", "BkgLcRho", o2::soa::Index<>, - bkglc::CandidateId, bkgrho::Rho, - bkgrho::RhoM); + bkgrho::RhoM, + o2::soa::Marker<2>); DECLARE_SOA_TABLE(BkgBplusRhos, "AOD", "BkgBPlRho", o2::soa::Index<>, - bkgbplus::CandidateId, bkgrho::Rho, - bkgrho::RhoM); + bkgrho::RhoM, + o2::soa::Marker<3>); DECLARE_SOA_TABLE(BkgDielectronRhos, "AOD", "BkgDIELRho", o2::soa::Index<>, - bkgdielectron::CandidateId, bkgrho::Rho, - bkgrho::RhoM); + bkgrho::RhoM, + o2::soa::Marker<4>); namespace jtracksub { diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index 6b0376a3e25..a749da6dcd3 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -34,6 +34,7 @@ struct eventWiseConstituentSubtractorTask { Produces trackSubtractedD0Table; Produces trackSubtractedLcTable; Produces trackSubtractedBplusTable; + Produces trackSubtractedDielectronTable; Configurable trackPtMin{"trackPtMin", 0.15, "minimum track pT"}; Configurable trackPtMax{"trackPtMax", 1000.0, "maximum track pT"}; @@ -66,25 +67,16 @@ 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); - Preslice perD0Candidate = aod::bkgd0::candidateId; - Preslice perLcCandidate = aod::bkglc::candidateId; - Preslice perBplusCandidate = aod::bkgbplus::candidateId; - Preslice perDielectronCandidate = aod::bkgdielectron::candidateId; - - template - void analyseHF(T const& tracks, U const& candidates, V const& bkgRhos, M& trackSubtractedTable) + template + void analyseHF(T const& tracks, U const& candidates, V& trackSubtractedTable) { for (auto& candidate : candidates) { - - auto const bkgRhosSliced = jetcandidateutilities::slicedPerCandidate(bkgRhos, candidate, perD0Candidate, perLcCandidate, perBplusCandidate, perDielectronCandidate); - auto const bkgRho = bkgRhosSliced.iteratorAt(0); - inputParticles.clear(); tracksSubtracted.clear(); jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); - tracksSubtracted = eventWiseConstituentSubtractor.JetBkgSubUtils::doEventConstSub(inputParticles, bkgRho.rho(), bkgRho.rhoM()); + tracksSubtracted = eventWiseConstituentSubtractor.JetBkgSubUtils::doEventConstSub(inputParticles, candidate.rho(), candidate.rhoM()); for (auto const& trackSubtracted : tracksSubtracted) { trackSubtractedTable(candidate.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), trackSubtracted.E(), jetderiveddatautilities::setSingleTrackSelectionBit(trackSelection)); @@ -107,23 +99,29 @@ struct eventWiseConstituentSubtractorTask { } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processCollisions, "Fill table of subtracted tracks for collisions", true); - void processD0Collisions(JetCollision const&, aod::BkgD0Rhos const& bkgRhos, soa::Filtered const& tracks, CandidatesD0Data const& candidates) + void processD0Collisions(JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { - analyseHF(tracks, candidates, bkgRhos, trackSubtractedD0Table); + analyseHF(tracks, candidates, trackSubtractedD0Table); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processD0Collisions, "Fill table of subtracted tracks for collisions with D0 candidates", false); - void processLcCollisions(JetCollision const&, aod::BkgLcRhos const& bkgRhos, soa::Filtered const& tracks, CandidatesLcData const& candidates) + void processLcCollisions(JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { - analyseHF(tracks, candidates, bkgRhos, trackSubtractedLcTable); + analyseHF(tracks, candidates, trackSubtractedLcTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processLcCollisions, "Fill table of subtracted tracks for collisions with Lc candidates", false); - void processBplusCollisions(JetCollision const&, aod::BkgBplusRhos const& bkgRhos, soa::Filtered const& tracks, CandidatesBplusData const& candidates) + void processBplusCollisions(JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { - analyseHF(tracks, candidates, bkgRhos, trackSubtractedBplusTable); + analyseHF(tracks, candidates, trackSubtractedBplusTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusCollisions, "Fill table of subtracted tracks for collisions with Bplus candidates", false); + + void processDielectronCollisions(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); }; 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 a5a543125a3..7a5be53476e 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -34,6 +34,7 @@ struct RhoEstimatorTask { Produces rhoD0Table; Produces rhoLcTable; Produces rhoBplusTable; + Produces rhoDielectronTable; Configurable trackPtMin{"trackPtMin", 0.15, "minimum track pT"}; Configurable trackPtMax{"trackPtMax", 1000.0, "maximum track pT"}; @@ -75,7 +76,7 @@ struct RhoEstimatorTask { inputParticles.clear(); jetfindingutilities::analyseTracks, soa::Filtered::iterator>(inputParticles, tracks, trackSelection, trackingEfficiency); auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); - rhoChargedTable(collision.globalIndex(), rho, rhoM); + rhoChargedTable(rho, rhoM); } PROCESS_SWITCH(RhoEstimatorTask, processChargedCollisions, "Fill rho tables for collisions using charged tracks", true); @@ -87,7 +88,7 @@ struct RhoEstimatorTask { jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); - rhoD0Table(candidate.globalIndex(), rho, rhoM); + rhoD0Table(rho, rhoM); } } PROCESS_SWITCH(RhoEstimatorTask, processD0Collisions, "Fill rho tables for collisions with D0 candidates", false); @@ -100,7 +101,7 @@ struct RhoEstimatorTask { jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); - rhoLcTable(candidate.globalIndex(), rho, rhoM); + rhoLcTable(rho, rhoM); } } PROCESS_SWITCH(RhoEstimatorTask, processLcCollisions, "Fill rho tables for collisions with Lc candidates", false); @@ -113,10 +114,23 @@ struct RhoEstimatorTask { jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); - rhoBplusTable(candidate.globalIndex(), rho, rhoM); + rhoBplusTable(rho, rhoM); } } PROCESS_SWITCH(RhoEstimatorTask, processBplusCollisions, "Fill rho tables for collisions with Bplus candidates", false); + + void processDielectronCollisions(JetCollision const&, soa::Filtered const& tracks, CandidatesDielectronData 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); + rhoDielectronTable(rho, rhoM); + } + } + PROCESS_SWITCH(RhoEstimatorTask, processDielectronCollisions, "Fill rho tables for collisions with Dielectron candidates", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"estimator-rho"})}; } diff --git a/PWGJE/Tasks/jetfinderhfQA.cxx b/PWGJE/Tasks/jetfinderhfQA.cxx index 9ec68be39a8..13a185ce36b 100644 --- a/PWGJE/Tasks/jetfinderhfQA.cxx +++ b/PWGJE/Tasks/jetfinderhfQA.cxx @@ -492,11 +492,6 @@ struct JetFinderHFQATask { PresliceOptional> perBplusCandidateTracks = aod::bkgbplus::candidateId; PresliceOptional> perDielectronCandidateTracks = aod::bkgdielectron::candidateId; - PresliceOptional perD0CandidateRhos = aod::bkgd0::candidateId; - PresliceOptional perLcCandidateRhos = aod::bkglc::candidateId; - PresliceOptional perBplusCandidateRhos = aod::bkgbplus::candidateId; - PresliceOptional perDielectronCandidateRhos = aod::bkgdielectron::candidateId; - template bool isAcceptedJet(V const& jet) { @@ -945,15 +940,14 @@ struct JetFinderHFQATask { } } - template - void randomCone(T const& collision, U const& jets, V const& candidates, M const& bkgRhos, N const& tracks) + template + void randomCone(T const& collision, U const& jets, V const& candidates, M const& tracks) { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } for (auto const& candidate : candidates) { - auto bkgRho = jetcandidateutilities::slicedPerCandidate(bkgRhos, candidate, perD0CandidateRhos, perLcCandidateRhos, perBplusCandidateRhos, perDielectronCandidateRhos).iteratorAt(0); TRandom3 randomNumber(0); float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); @@ -967,7 +961,7 @@ struct JetFinderHFQATask { } } } - registry.fill(HIST("h2_centrality_rhorandomcone"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * bkgRho.rho()); + registry.fill(HIST("h2_centrality_rhorandomcone"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * candidate.rho()); // removing the leading jet from the random cone if (jets.size() > 0) { // if there are no jets in the acceptance (from the jetfinder cuts) then there can be no leading jet @@ -995,7 +989,7 @@ struct JetFinderHFQATask { } } } - registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * bkgRho.rho()); + registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), collision.centrality(), randomConePt - M_PI * randomConeR * randomConeR * candidate.rho()); break; // currently only fills it for the first candidate in the event (not pT ordered). Jet is pT ordered so results for excluding leading jet might not be as expected } } @@ -1020,9 +1014,8 @@ struct JetFinderHFQATask { PROCESS_SWITCH(JetFinderHFQATask, processJetsData, "jet finder HF QA data", false); void processJetsRhoAreaSubData(soa::Filtered::iterator const& collision, - BkgRhoTable const& bkgRhos, JetTableDataJoined const& jets, - CandidateTableData const&, + soa::Join const&, JetTracks const&) { for (auto const& jet : jets) { @@ -1032,17 +1025,15 @@ struct JetFinderHFQATask { if (!isAcceptedJet(jet)) { continue; } - auto const jetCandidate = jet.template candidates_first_as(); - auto bkgRho = jetcandidateutilities::slicedPerCandidate(bkgRhos, jetCandidate, perD0CandidateRhos, perLcCandidateRhos, perBplusCandidateRhos, perDielectronCandidateRhos).iteratorAt(0); - fillRhoAreaSubtractedHistograms(jet, collision.centrality(), bkgRho.rho()); + auto const candidate = jet.template candidates_first_as>(); + fillRhoAreaSubtractedHistograms(jet, collision.centrality(), candidate.rho()); } } PROCESS_SWITCH(JetFinderHFQATask, processJetsRhoAreaSubData, "jet finder HF QA for rho-area subtracted jets", false); void processJetsRhoAreaSubMCD(soa::Filtered::iterator const& collision, - BkgRhoTable const& bkgRhos, JetTableMCDJoined const& jets, - CandidateTableMCD const&, + soa::Join const&, JetTracks const&) { for (auto const& jet : jets) { @@ -1052,9 +1043,8 @@ struct JetFinderHFQATask { if (!isAcceptedJet(jet)) { continue; } - auto const jetCandidate = jet.template candidates_first_as(); - auto bkgRho = jetcandidateutilities::slicedPerCandidate(bkgRhos, jetCandidate, perD0CandidateRhos, perLcCandidateRhos, perBplusCandidateRhos, perDielectronCandidateRhos).iteratorAt(0); - fillRhoAreaSubtractedHistograms(jet, collision.centrality(), bkgRho.rho()); + auto const candidate = jet.template candidates_first_as>(); + fillRhoAreaSubtractedHistograms(jet, collision.centrality(), candidate.rho()); } } PROCESS_SWITCH(JetFinderHFQATask, processJetsRhoAreaSubMCD, "jet finder HF QA for rho-area subtracted mcd jets", false); @@ -1520,13 +1510,12 @@ struct JetFinderHFQATask { } PROCESS_SWITCH(JetFinderHFQATask, processTracksSub, "QA for charged event-wise embedded subtracted tracks", false); - void processRho(JetCollision const& collision, CandidateTableData const& candidates, BkgRhoTable const& bkgRhos, soa::Filtered const& tracks) + void processRho(JetCollision const& collision, soa::Join const& candidates, soa::Filtered const& tracks) { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } for (auto const& candidate : candidates) { - auto bkgRho = jetcandidateutilities::slicedPerCandidate(bkgRhos, candidate, perD0CandidateRhos, perLcCandidateRhos, perBplusCandidateRhos, perDielectronCandidateRhos).iteratorAt(0); int nTracks = 0; for (auto const& track : tracks) { if (jetderiveddatautilities::selectTrack(track, trackSelection)) { @@ -1534,24 +1523,24 @@ struct JetFinderHFQATask { } } registry.fill(HIST("h2_centrality_ntracks"), collision.centrality(), nTracks); - registry.fill(HIST("h2_ntracks_rho"), nTracks, bkgRho.rho()); - registry.fill(HIST("h2_ntracks_rhom"), nTracks, bkgRho.rhoM()); - registry.fill(HIST("h2_centrality_rho"), collision.centrality(), bkgRho.rho()); - registry.fill(HIST("h2_centrality_rhom"), collision.centrality(), bkgRho.rhoM()); + registry.fill(HIST("h2_ntracks_rho"), nTracks, candidate.rho()); + registry.fill(HIST("h2_ntracks_rhom"), nTracks, candidate.rhoM()); + registry.fill(HIST("h2_centrality_rho"), collision.centrality(), candidate.rho()); + registry.fill(HIST("h2_centrality_rhom"), collision.centrality(), candidate.rhoM()); break; // currently only fills it for the first candidate in the event (not pT ordered) } } PROCESS_SWITCH(JetFinderHFQATask, processRho, "QA for rho-area subtracted jets", false); - void processRandomConeData(soa::Filtered::iterator const& collision, JetTableDataJoined const& jets, CandidateTableData const& candidates, BkgRhoTable const& bkgRhos, soa::Filtered const& tracks) + void processRandomConeData(soa::Filtered::iterator const& collision, JetTableDataJoined const& jets, soa::Join const& candidates, soa::Filtered const& tracks) { - randomCone(collision, jets, candidates, bkgRhos, tracks); + randomCone(collision, jets, candidates, tracks); } PROCESS_SWITCH(JetFinderHFQATask, processRandomConeData, "QA for random cone estimation of background fluctuations in data", false); - void processRandomConeMCD(soa::Filtered::iterator const& collision, JetTableMCDJoined const& jets, CandidateTableMCD const& candidates, BkgRhoTable const& bkgRhos, soa::Filtered const& tracks) + void processRandomConeMCD(soa::Filtered::iterator const& collision, JetTableMCDJoined const& jets, soa::Join const& candidates, soa::Filtered const& tracks) { - randomCone(collision, jets, candidates, bkgRhos, tracks); + randomCone(collision, jets, candidates, tracks); } PROCESS_SWITCH(JetFinderHFQATask, processRandomConeMCD, "QA for random cone estimation of background fluctuations in mcd", false); From 79c8ad346aa7d1e249e13e71a1c0c5699e9f0297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 5 Sep 2024 18:03:41 +0200 Subject: [PATCH 32/60] [AOT] add data split track QA (#7578) --- DPG/Tasks/AOTTrack/qaTrackSplitting.cxx | 77 ++++++++++++++++++++----- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx b/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx index ca73e9006fd..3125f1e7c03 100644 --- a/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx +++ b/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx @@ -22,7 +22,9 @@ #include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/TrackSelectionTables.h" +using namespace o2; using namespace o2::framework; +using namespace o2::framework::expressions; struct qaTrackSplitting { Configurable pdg{"pdg", 2212, "PDG code of the particle to be analysed"}; @@ -40,6 +42,14 @@ struct qaTrackSplitting { Configurable maxDcaXY{"maxDcaXY", 10000.f, "Additional cut on the maximum abs value of the DCA xy"}; Configurable maxDcaZ{"maxDcaZ", 2.f, "Additional cut on the maximum abs value of the DCA z"}; Configurable minTPCNClsFound{"minTPCNClsFound", 0.f, "Additional cut on the minimum value of the number of found clusters in the TPC"}; + + Configurable windowEta{"windowEta", 0.f, "Position in eta of the window"}; + Configurable windowEtaWidth{"windowEtaWidth", 0.1f, "Width of the eta window"}; + Configurable windowPhi{"windowPhi", 0.785f, "Position in phi of the window"}; + Configurable windowPhiWidth{"windowPhiWidth", 0.1f, "Width of the phi window"}; + Configurable windowPt{"windowPt", 1.f, "Position in pt of the window"}; + Configurable windowPtWidth{"windowPtWidth", 0.1f, "Width of the pt window"}; + } cfgCustomTrackCuts; // Histograms @@ -51,6 +61,7 @@ struct qaTrackSplitting { histos.add("tracks", "tracsk", kTH1D, {{10, -0.5, 9.5, "Track selection"}}); histos.add("numberOfRecoed", "recoed", kTH1D, {{10, -0.5, 9.5, "Number of tracks associated to a particle"}}); histos.add("map", "map", kTH3D, {{100, -1, 1, "#Delta #eta"}, {100, -1, 1, "#Delta #varphi"}, {100, -1, 1, "#Delta #it{p}_{T}"}}); + histos.add("deltaPt", "deltaPt", kTH2D, {{100, 0, 5, "#it{p}_{T}"}, {100, -1, 1, "#Delta #it{p}_{T}"}}); histos.add("mapMC", "mapMC", kTH3D, {{100, -1, 1, "#Delta #eta"}, {100, -1, 1, "#Delta #varphi"}, {100, -1, 1, "#Delta #it{p}_{T}"}}); customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(cfgCustomTrackCuts.itsPattern); @@ -69,16 +80,46 @@ struct qaTrackSplitting { customTrackCuts.print(); } - // Global process - using TrackCandidates = o2::soa::Join; - void process(o2::soa::Join::iterator const& collision, - TrackCandidates const& tracks, - o2::aod::McParticles const&) + using CollisionCandidates = o2::soa::Join; + using TrackCandidates = o2::soa::Join; + Filter trackFilterEta = nabs(aod::track::eta - cfgCustomTrackCuts.windowEta) < cfgCustomTrackCuts.windowEtaWidth; + Filter trackFilterPhi = nabs(aod::track::phi - cfgCustomTrackCuts.windowPhi) < cfgCustomTrackCuts.windowPhiWidth; + Filter trackFilterITS = (aod::track::itsClusterSizes > (uint32_t)0); + Filter trackFilterTPC = (aod::track::tpcNClsFindable > (uint8_t)0); + // Filter trackFilterType = (aod::track::TrackType == aod::track::Track); + // Filter filterPt = nabs(aod::track::pt - cfgCustomTrackCuts.windowPt) < cfgCustomTrackCuts.windowPtWidth; + void processData(CollisionCandidates const& collisions, + soa::Filtered const& filteredTracks) + { + for (const auto& coll1 : collisions) { + for (const auto& coll2 : collisions) { + if (coll1.globalIndex() == coll2.globalIndex()) { + continue; + } + for (const auto& track2 : filteredTracks) { + // Compute the delta in pT + for (const auto& track1 : filteredTracks) { + if (track1.globalIndex() == track2.globalIndex()) { + continue; + } + histos.fill(HIST("deltaPt"), track1.pt(), track1.pt() - track2.pt()); + } + } + } + } + } + PROCESS_SWITCH(qaTrackSplitting, processData, "Process Data", true); + + using CollisionCandidatesMC = soa::Join; + using TrackCandidatesMC = o2::soa::Join; + void processMC(CollisionCandidatesMC::iterator const& collision, + TrackCandidatesMC const& tracks, + o2::aod::McParticles const&) { if (!collision.sel8()) { return; } - typedef std::shared_ptr trkType; + typedef std::shared_ptr trkType; std::map> particleUsageCounter; for (auto track : tracks) { @@ -87,11 +128,12 @@ struct qaTrackSplitting { continue; } histos.fill(HIST("tracks"), 1); - if (track.mcParticle().pdgCode() != pdg) { + const auto& mcParticle = track.mcParticle(); + if (mcParticle.pdgCode() != pdg) { continue; } histos.fill(HIST("tracks"), 2); - if (!track.mcParticle().isPhysicalPrimary()) { + if (!mcParticle.isPhysicalPrimary()) { continue; } histos.fill(HIST("tracks"), 3); @@ -101,21 +143,28 @@ struct qaTrackSplitting { histos.fill(HIST("tracks"), 4); particleUsageCounter[track.mcParticleId()].push_back(std::make_shared(track)); } - for (const auto& [mcId, tracks] : particleUsageCounter) { - histos.fill(HIST("numberOfRecoed"), tracks.size()); - if (tracks.size() > 1) { + for (const auto& [mcId, tracksMatched] : particleUsageCounter) { + histos.fill(HIST("numberOfRecoed"), tracksMatched.size()); + if (tracksMatched.size() > 1) { bool isFirst = true; - for (const auto& track : tracks) { + for (const auto& track : tracksMatched) { if (isFirst) { isFirst = false; - histos.fill(HIST("mapMC"), track->eta() - track->mcParticle().eta(), track->phi() - track->mcParticle().phi(), track->pt() - track->mcParticle().pt()); + histos.fill(HIST("mapMC"), + track->eta() - track->mcParticle().eta(), + track->phi() - track->mcParticle().phi(), + track->pt() - track->mcParticle().pt()); continue; } - histos.fill(HIST("map"), track->eta() - tracks[0]->eta(), track->phi() - tracks[0]->phi(), track->pt() - tracks[0]->pt()); + histos.fill(HIST("map"), + track->eta() - tracksMatched[0]->eta(), + track->phi() - tracksMatched[0]->phi(), + track->pt() - tracksMatched[0]->pt()); } } } } + PROCESS_SWITCH(qaTrackSplitting, processMC, "Process MC", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From e21c18ae4ecaac43c683bd4ae18ddfe24c938ffc Mon Sep 17 00:00:00 2001 From: Chuntai <48704924+Libeiyu@users.noreply.github.com> Date: Fri, 6 Sep 2024 03:32:32 +0800 Subject: [PATCH 33/60] PWGHF: Uncomment the DCA cut in the D0 selector (#7555) * Uncomment the DCA cut * Update PWGHF/TableProducer/candidateSelectorD0.cxx * add DECLARE_SOA_DYNAMIC_COLUMN ImpactParameterXY * w/o capital initial letter * update * Update PWGHF/TableProducer/candidateSelectorD0.cxx Co-authored-by: Mattia Faggin * Update candidateSelectorD0.cxx --------- Co-authored-by: Mattia Faggin --- PWGHF/TableProducer/candidateSelectorD0.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/candidateSelectorD0.cxx b/PWGHF/TableProducer/candidateSelectorD0.cxx index 46a8a747d74..ce2b7e9f1bf 100644 --- a/PWGHF/TableProducer/candidateSelectorD0.cxx +++ b/PWGHF/TableProducer/candidateSelectorD0.cxx @@ -162,7 +162,9 @@ struct HfCandidateSelectorD0 { return false; } // candidate DCA - // if (candidate.chi2PCA() > cuts[pTBin][1]) return false; + if (candidate.impactParameterXY() > cuts->get(pTBin, "DCA")) { + return false; + } // candidate topological chi2 over ndf when using KFParticle, need to add this selection to the SelectorCuts.h // if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { From 52298e017d2b90978551c18ad78a0badeb4cf276 Mon Sep 17 00:00:00 2001 From: feisenhu <53603353+feisenhu@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:29:16 +0200 Subject: [PATCH 34/60] [PWGDQ] TtCA, adding propagation of track to collisions on pair level (#7575) --- PWGDQ/Core/VarManager.h | 114 ++++++++++++++++++++++++++ PWGDQ/Tasks/tableReader_withAssoc.cxx | 12 ++- 2 files changed, 125 insertions(+), 1 deletion(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index d7cde9afe50..0adc70b7169 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -913,6 +913,10 @@ class VarManager : public TObject static void FillGlobalMuonRefit(T1 const& muontrack, T2 const& mfttrack, const C& collision, float* values = nullptr); template static void FillPair(T1 const& t1, T2 const& t2, float* values = nullptr); + template + static void FillPairCollision(C const& collision, T1 const& t1, T2 const& t2, float* values = nullptr); + template + 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 @@ -2539,6 +2543,116 @@ void VarManager::FillPair(T1 const& t1, T2 const& t2, float* values) } } +template +void VarManager::FillPairCollision(const C& collision, T1 const& t1, T2 const& t2, float* values) +{ + if (!values) { + values = fgValues; + } + + if constexpr ((pairType == kDecayToEE) && ((fillMap & TrackCov) > 0 || (fillMap & ReducedTrackBarrelCov) > 0)) { + + if (fgUsedVars[kQuadDCAabsXY] || fgUsedVars[kQuadDCAsigXY] || fgUsedVars[kQuadDCAabsZ] || fgUsedVars[kQuadDCAsigZ] || fgUsedVars[kQuadDCAsigXYZ] || fgUsedVars[kSignQuadDCAsigXY]) { + + auto trackPart1 = getTrackPar(t1); + std::array dca1{1e10f, 1e10f}; + trackPart1.propagateParamToDCA({collision.posX(), collision.posY(), collision.posZ()}, fgMagField, &dca1); + + auto trackPart2 = getTrackPar(t2); + std::array dca2{1e10f, 1e10f}; + trackPart2.propagateParamToDCA({collision.posX(), collision.posY(), collision.posZ()}, fgMagField, &dca2); + + // Recalculated quantities + double dca1XY = dca1[0]; + double dca2XY = dca2[0]; + double dca1Z = dca1[1]; + double dca2Z = dca2[1]; + double dca1sigXY = dca1XY / std::sqrt(t1.cYY()); + double dca2sigXY = dca2XY / std::sqrt(t2.cYY()); + double dca1sigZ = dca1Z / std::sqrt(t1.cZZ()); + double dca2sigZ = dca2Z / std::sqrt(t2.cZZ()); + + values[kQuadDCAabsXY] = std::sqrt((dca1XY * dca1XY + dca2XY * dca2XY) / 2); + values[kQuadDCAsigXY] = std::sqrt((dca1sigXY * dca1sigXY + dca2sigXY * dca2sigXY) / 2); + values[kQuadDCAabsZ] = std::sqrt((dca1Z * dca1Z + dca2Z * dca2Z) / 2); + values[kQuadDCAsigZ] = std::sqrt((dca1sigZ * dca1sigZ + dca2sigZ * dca2sigZ) / 2); + values[kSignQuadDCAsigXY] = t1.sign() * t2.sign() * TMath::Sign(1., dca1sigXY) * TMath::Sign(1., dca2sigXY) * std::sqrt((dca1sigXY * dca1sigXY + dca2sigXY * dca2sigXY) / 2); + + double det1 = t1.cYY() * t1.cZZ() - t1.cZY() * t1.cZY(); + double det2 = t2.cYY() * t2.cZZ() - t2.cZY() * t2.cZY(); + if ((det1 < 0) || (det2 < 0)) { + values[kQuadDCAsigXYZ] = -999; + } else { + double chi2t1 = (dca1XY * dca1XY * t1.cZZ() + dca1Z * dca1Z * t1.cYY() - 2. * dca1XY * dca1Z * t1.cZY()) / det1; + double chi2t2 = (dca2XY * dca2XY * t2.cZZ() + dca2Z * dca2Z * t2.cYY() - 2. * dca2XY * dca2Z * t2.cZY()) / det2; + + double dca1sigXYZ = std::sqrt(std::abs(chi2t1) / 2.); + double dca2sigXYZ = std::sqrt(std::abs(chi2t2) / 2.); + + values[kQuadDCAsigXYZ] = std::sqrt((dca1sigXYZ * dca1sigXYZ + dca2sigXYZ * dca2sigXYZ) / 2); + } + } + } +} + +template +void VarManager::FillPairCollisionMatCorr(C const& collision, T1 const& t1, T2 const& t2, M const& materialCorr, P const& propagator, float* values) +{ + if (!values) { + values = fgValues; + } + + if constexpr ((pairType == kDecayToEE) && ((fillMap & TrackCov) > 0 || (fillMap & ReducedTrackBarrelCov) > 0)) { + + if (fgUsedVars[kQuadDCAabsXY] || fgUsedVars[kQuadDCAsigXY] || fgUsedVars[kQuadDCAabsZ] || fgUsedVars[kQuadDCAsigZ] || fgUsedVars[kQuadDCAsigXYZ] || fgUsedVars[kSignQuadDCAsigXY]) { + + auto trackPart1 = getTrackPar(t1); + std::array dca1{1e10f, 1e10f}; + std::array pVect1 = {t1.px(), t1.py(), t1.pz()}; + // trackPar.propagateParamToDCA({collision.posX(), collision.posY(), collision.posZ()}, fgMagField, &dca); + propagator->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackPart1, 2.f, materialCorr, &dca1); + getPxPyPz(trackPart1, pVect1); + + auto trackPart2 = getTrackPar(t2); + std::array dca2{1e10f, 1e10f}; + std::array pVect2 = {t2.px(), t2.py(), t2.pz()}; + // trackPar.propagateParamToDCA({collision.posX(), collision.posY(), collision.posZ()}, fgMagField, &dca); + propagator->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackPart2, 2.f, materialCorr, &dca2); + getPxPyPz(trackPart2, pVect2); + + // Recalculated quantities + double dca1XY = dca1[0]; + double dca2XY = dca2[0]; + double dca1Z = dca1[1]; + double dca2Z = dca2[1]; + double dca1sigXY = dca1XY / std::sqrt(t1.cYY()); + double dca2sigXY = dca2XY / std::sqrt(t2.cYY()); + double dca1sigZ = dca1Z / std::sqrt(t1.cZZ()); + double dca2sigZ = dca2Z / std::sqrt(t2.cZZ()); + + values[kQuadDCAabsXY] = std::sqrt((dca1XY * dca1XY + dca2XY * dca2XY) / 2); + values[kQuadDCAsigXY] = std::sqrt((dca1sigXY * dca1sigXY + dca2sigXY * dca2sigXY) / 2); + values[kQuadDCAabsZ] = std::sqrt((dca1Z * dca1Z + dca2Z * dca2Z) / 2); + values[kQuadDCAsigZ] = std::sqrt((dca1sigZ * dca1sigZ + dca2sigZ * dca2sigZ) / 2); + values[kSignQuadDCAsigXY] = t1.sign() * t2.sign() * TMath::Sign(1., dca1sigXY) * TMath::Sign(1., dca2sigXY) * std::sqrt((dca1sigXY * dca1sigXY + dca2sigXY * dca2sigXY) / 2); + + double det1 = t1.cYY() * t1.cZZ() - t1.cZY() * t1.cZY(); + double det2 = t2.cYY() * t2.cZZ() - t2.cZY() * t2.cZY(); + if ((det1 < 0) || (det2 < 0)) { + values[kQuadDCAsigXYZ] = -999; + } else { + double chi2t1 = (dca1XY * dca1XY * t1.cZZ() + dca1Z * dca1Z * t1.cYY() - 2. * dca1XY * dca1Z * t1.cZY()) / det1; + double chi2t2 = (dca2XY * dca2XY * t2.cZZ() + dca2Z * dca2Z * t2.cYY() - 2. * dca2XY * dca2Z * t2.cZY()) / det2; + + double dca1sigXYZ = std::sqrt(std::abs(chi2t1) / 2.); + double dca2sigXYZ = std::sqrt(std::abs(chi2t2) / 2.); + + values[kQuadDCAsigXYZ] = std::sqrt((dca1sigXYZ * dca1sigXYZ + dca2sigXYZ * dca2sigXYZ) / 2); + } + } + } +} + template void VarManager::FillTriple(T1 const& t1, T2 const& t2, T3 const& t3, float* values, PairCandidateType pairType) { diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 1fe6175fca1..58fff03663d 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -907,7 +907,7 @@ struct AnalysisSameEventPairing { Configurable fConfigPairCuts{"cfgPairCuts", "", "Comma separated list of pair cuts"}; Configurable fConfigMixingDepth{"cfgMixingDepth", 100, "Number of Events stored for event mixing"}; - Configurable fConfigAddEventMixingHistogram{"cfgAddEventMixingHistogram", "", "Comma separated list of histograms"}; + // 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"}; @@ -927,6 +927,8 @@ struct AnalysisSameEventPairing { 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"}; Service fCCDB; @@ -1290,6 +1292,10 @@ struct AnalysisSameEventPairing { } VarManager::FillPair(t1, t2); + // compute quantities which depend on the associated collision, such as DCA + if (fPropTrack) { + VarManager::FillPairCollision(event, t1, t2); + } if constexpr (TTwoProngFitter) { VarManager::FillPairVertexing(event, t1, t2, fConfigPropToPCA); } @@ -1351,6 +1357,10 @@ struct AnalysisSameEventPairing { } VarManager::FillPair(t1, t2); + // compute quantities which depend on the associated collision, such as DCA + if (fPropTrack) { + VarManager::FillPairCollision(event, t1, t2); + } if constexpr (TTwoProngFitter) { VarManager::FillPairVertexing(event, t1, t2, fConfigPropToPCA); } From 92dd21f55c19ce83762bf0802f046c7ac452516d Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:56:33 +0200 Subject: [PATCH 35/60] PWGCF / FemtoUniverse : Changing MultNtr to multV0M (centFT0C) (#7581) --- ...rsePairTaskTrackTrackSpherHarMultKtExtended.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 9d4f278c51e..a2aeb512642 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -149,7 +149,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { 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}; + ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; ConfigurableAxis ConfkstarBins{"ConfkstarBins", {60, 0.0, 0.3}, "binning kstar"}; ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; @@ -413,7 +413,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { 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.multV0M()})); eventHisto.fillQA(col); } @@ -544,15 +544,15 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { bool fillQA = true; if (cfgProcessPM) { - doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 1, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 1, fillQA); } if (cfgProcessPP) { - doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multNtr(), 2, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multV0M(), 2, fillQA); } if (cfgProcessMM) { - doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 3, fillQA); + doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 3, fillQA); } } PROCESS_SWITCH(femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processSameEvent, "Enable processing same event", true); @@ -630,7 +630,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, cols, cols)) { - const int multiplicityCol = collision1.multNtr(); + const int multiplicityCol = collision1.multV0M(); MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); const auto& magFieldTesla1 = collision1.magField(); @@ -690,7 +690,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, cols, cols)) { - const int multiplicityCol = collision1.multNtr(); + const int multiplicityCol = collision1.multV0M(); MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); const auto& magFieldTesla1 = collision1.magField(); From c2646a07e0a6c273024d5263e08e8d5667488d59 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Fri, 6 Sep 2024 04:21:46 +0200 Subject: [PATCH 36/60] PWGEM/Dilepton: update dilepton and QC task (#7586) --- PWGEM/Dilepton/Core/Dilepton.h | 8 ++++--- PWGEM/Dilepton/Tasks/eventQC.cxx | 41 ++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 1acf3739ae6..1255519359b 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -94,8 +94,9 @@ struct Dilepton { 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 spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path of SP resolution file"}; Configurable cfgApplySPresolution{"cfgApplySPresolution", false, "flag to apply resolution correction for flow analysis"}; + Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path to SP resolution file"}; + Configurable spresoHistName{"spresoHistName", "h1_R2_FT0M_BPos_BNeg", "histogram name of SP resolution file"}; Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kVM:5, kHFll:6"}; Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; @@ -426,8 +427,9 @@ struct Dilepton { } if (cfgApplySPresolution) { - auto list = ccdb->getForTimeStamp(spresoPath, 10); - h1sp_resolution = reinterpret_cast(list->FindObject("histo_SP_R2_FT0M_BPos_BNeg")); + auto list = ccdb->getForTimeStamp(spresoPath, collision.timestamp()); + h1sp_resolution = reinterpret_cast(list->FindObject(spresoHistName.value.data())); + // h1sp_resolution = ccdb->getForTimeStamp(spresoPath.value + "/" + spresoHistName.value, collision.timestamp()); LOGF(info, "h1sp_resolution.GetBinContent(40) = %f", h1sp_resolution->GetBinContent(40)); } } diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index 719fcc8df5c..768077d3df6 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -55,11 +55,13 @@ struct eventQC { Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable cfgFillPID{"cfgFillPID", false, "fill PID histograms"}; - Configurable> cfgnMods{"cfgnMods", {2, 3, 4}, "Modulation of interest. Please keep increasing order"}; + Configurable> cfgnMods{"cfgnMods", {2, 3}, "Modulation of interest. Please keep increasing order"}; Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - ConfigurableAxis ConfPtBins{"ConfPtBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 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}, "pT bins for output histograms"}; + ConfigurableAxis ConfPtBins{"ConfPtBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 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.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pT bins for output histograms"}; + Configurable cfgNbinsEta{"cfgNbinsEta", 40, "number of eta bins for output histograms"}; + Configurable cfgNbinsPhi{"cfgNbinsPhi", 360, "number of phi bins for output histograms"}; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; @@ -135,7 +137,7 @@ struct eventQC { fRegistry.add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", kTH1F, {{110, 0, 110}}, false); fRegistry.add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", kTH1F, {{110, 0, 110}}, false); fRegistry.add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", kTH1F, {{110, 0, 110}}, false); - fRegistry.add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", kTH2F, {{110, 0, 110}, {600, 0, 6000}}, false); + fRegistry.add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", kTH2F, {{100, 0, 100}, {600, 0, 6000}}, false); fRegistry.add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", kTH2F, {{60, 0, 60000}, {600, 0, 6000}}, false); fRegistry.add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", kTH2F, {{60, 0, 60000}, {200, 0, 20000}}, false); fRegistry.add("Event/before/hNTracksPVvsOccupancy", "hNTracksPVvsOccupancy;N_{track} to PV;N_{track} in time range", kTH2F, {{600, 0, 6000}, {200, 0, 20000}}, false); @@ -144,10 +146,10 @@ struct eventQC { fRegistry.addClone("Event/before/", "Event/after/"); fRegistry.add("Event/after/hMultNGlobalTracks", "hMultNGlobalTracks; N_{track}^{global}", kTH1F, {{6001, -0.5, 6000.5}}, false); - fRegistry.add("Event/after/hCentFT0CvsMultNGlobalTracks", "hCentFT0CvsMultNGlobalTracks;centrality FT0C (%);N_{track}^{global}", kTH2F, {{110, 0, 110}, {600, 0, 6000}}, false); + fRegistry.add("Event/after/hCentFT0CvsMultNGlobalTracks", "hCentFT0CvsMultNGlobalTracks;centrality FT0C (%);N_{track}^{global}", kTH2F, {{100, 0, 100}, {600, 0, 6000}}, false); fRegistry.add("Event/after/hMultFT0CvsMultNGlobalTracks", "hMultFT0CvsMultNGlobalTracks;mult. FT0C;N_{track}^{global}", kTH2F, {{60, 0, 60000}, {600, 0, 6000}}, false); fRegistry.add("Event/after/hMultNGlobalTracksPV", "hMultNGlobalTracksPV; N_{track}^{global} to PV", kTH1F, {{6001, -0.5, 6000.5}}, false); - fRegistry.add("Event/after/hCentFT0CvsMultNGlobalTracksPV", "hCentFT0CvsMultNGlobalTracksPV;centrality FT0C (%);N_{track}^{global} to PV", kTH2F, {{110, 0, 110}, {600, 0, 6000}}, false); + fRegistry.add("Event/after/hCentFT0CvsMultNGlobalTracksPV", "hCentFT0CvsMultNGlobalTracksPV;centrality FT0C (%);N_{track}^{global} to PV", kTH2F, {{100, 0, 100}, {600, 0, 6000}}, false); fRegistry.add("Event/after/hMultFT0CvsMultNGlobalTracksPV", "hMultFT0CvsMultNGlobalTracksPV;mult. FT0C;N_{track}^{global} to PV", kTH2F, {{60, 0, 60000}, {600, 0, 6000}}, false); for (int i = 0; i < static_cast(cfgnMods->size()); i++) { @@ -184,18 +186,27 @@ struct eventQC { fRegistry.add(Form("Event/after/Qvector/hPrfQ%dFT0AQ%dFT0C_CentFT0C", nmod, nmod), Form("Q_{%d}^{FT0A} #upoint Q_{%d}^{FT0C};centrality FT0C (%%);Q_{%d}^{FT0A} #upoint Q_{%d}^{FT0C}", nmod, nmod, nmod, nmod), kTProfile, {{100, 0, 100}}, false); } + std::vector tmp_ptbins; + for (int i = 0; i < 100; i++) { + tmp_ptbins.emplace_back(0.01 * i); // every 0.01 GeV/c from 0 to 1 GeV/c + } + for (int i = 0; i < 91; i++) { + tmp_ptbins.emplace_back(0.1 * i + 1.f); // every 0.1 GeV/c from 1 to 10 GeV/c + } + const AxisSpec axis_pt_tmp{tmp_ptbins, "p_{T} (GeV/c)"}; + const AxisSpec axis_pt{ConfPtBins, "p_{T} (GeV/c)"}; - const AxisSpec axis_eta{20, -1.0, +1.0, "#eta"}; - const AxisSpec axis_phi{72, 0.0, 2 * M_PI, "#varphi (rad.)"}; + const AxisSpec axis_eta{cfgNbinsEta, -1.0, +1.0, "#eta"}; + const AxisSpec axis_phi{cfgNbinsPhi, 0.0, 2 * M_PI, "#varphi (rad.)"}; const AxisSpec axis_sign{3, -1.5, +1.5, "sign"}; - fRegistry.add("Track/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_sign}, true); + fRegistry.add("Track/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_sign}, false); fRegistry.add("Track/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{400, -20, 20}}, false); fRegistry.add("Track/hSigma1Pt", "#sigma_{1/p_{T}} vs. q/p_{T};q/p_{T} (GeV/c)^{-1};#sigma_{1/p_{T}} (GeV/c)^{-1}", kTH2F, {{400, -20, 20}, {200, 0, 0.2}}, false); - fRegistry.add("Track/hRelSigma1Pt", "relative p_{T} resolution;p_{T} (GeV/c);#sigma_{1/p_{T}} #times p_{T}", kTH2F, {{1000, 0, 10}, {100, 0, 0.1}}, false); + fRegistry.add("Track/hRelSigma1Pt", "relative p_{T} resolution;p_{T} (GeV/c);#sigma_{1/p_{T}} #times p_{T}", kTH2F, {axis_pt_tmp, {100, 0, 0.1}}, false); fRegistry.add("Track/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {200, -1.0f, 1.0f}}, false); fRegistry.add("Track/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/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/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/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {axis_pt_tmp, {500, 0., 500}}, false); + fRegistry.add("Track/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", kTH2F, {axis_pt_tmp, {500, 0., 500}}, false); fRegistry.add("Track/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("Track/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("Track/hChi2TPC", "chi2/number of TPC clusters", kTH1F, {{100, 0, 10}}, false); @@ -294,7 +305,7 @@ struct eventQC { if (collision.sel8()) { fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 10.0); } - if (abs(collision.posZ()) < 10.0) { + if (fabs(collision.posZ()) < 10.0) { fRegistry.fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 11.0); } if (collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { @@ -453,7 +464,7 @@ struct eventQC { { bool is_good = true; for (auto& qvec : qvectors) { - if (abs(qvec[0]) > 10.f || abs(qvec[1]) > 10.f) { + if (fabs(qvec[0]) > 10.f || fabs(qvec[1]) > 10.f) { is_good = false; break; } @@ -494,7 +505,7 @@ struct eventQC { return false; } - if (abs(collision.posZ()) > eventcuts.cfgZvtxMax) { + if (fabs(collision.posZ()) > eventcuts.cfgZvtxMax) { return false; } @@ -572,7 +583,7 @@ struct eventQC { } fillTrackInfo(track); - if (abs(track.eta()) < 0.8) { + if (fabs(track.eta()) < 0.8) { nGlobalTracks++; if (track.isPVContributor()) { nGlobalTracksPV++; From b291dda091ea9f80e0d9bf95ed9df3bf844014fd Mon Sep 17 00:00:00 2001 From: dajones2 <140733426+dajones2@users.noreply.github.com> Date: Fri, 6 Sep 2024 05:02:48 +0100 Subject: [PATCH 37/60] PWGJE: Adding particle level MC selections (#7587) * PWGJE: Adding particle level MC selections * Formatting * Duplicate include files --- PWGJE/Tasks/jetHadronRecoil.cxx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index 7d76b0e4288..14733c99de6 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -69,7 +69,7 @@ struct hJetAnalysis { Filter jetCuts = aod::jet::r == nround(jetR.node() * 100.0f); Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); - Filter eventCuts = nabs(aod::jcollision::posZ) < vertexZCut; + Filter eventTrackLevelCuts = nabs(aod::jcollision::posZ) < vertexZCut; HistogramRegistry registry{"registry", {{"hNtrig", "number of triggers;trigger type;entries", {HistType::kTH1F, {{2, 0, 2}}}}, @@ -123,6 +123,8 @@ struct hJetAnalysis { int eventSelection = -1; int trackSelection = -1; + Service pdg; + void init(InitContext const&) { eventSelection = jetderiveddatautilities::initialiseEventSelection(static_cast(eventSelections)); @@ -130,7 +132,7 @@ struct hJetAnalysis { Filter jetCuts = aod::jet::r == nround(jetR.node() * 100.0f); Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); - Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut); + Filter eventTrackLevelCuts = nabs(aod::jcollision::posZ) < vertexZCut; } template @@ -268,6 +270,13 @@ struct hJetAnalysis { is_sig_col = false; for (auto& particle : particles) { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle) { + continue; + } + 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++; @@ -436,7 +445,7 @@ struct hJetAnalysis { } PROCESS_SWITCH(hJetAnalysis, processMCD, "process MC detector level", false); - void processMCDWeighted(soa::Join::iterator const& collision, + void processMCDWeighted(soa::Join, aod::JMcCollisionLbs>::iterator const& collision, soa::Filtered> const& jets, soa::Filtered> const& jetsWTA, soa::Filtered const& tracks) @@ -448,11 +457,14 @@ struct hJetAnalysis { } PROCESS_SWITCH(hJetAnalysis, processMCDWeighted, "process MC detector level with event weights", false); - void processMCP(JetMcCollision const& /*collision*/, + void processMCP(JetMcCollision const& collision, soa::Filtered> const& jets, soa::Filtered> const& jetsWTA, JetParticles const& particles) { + if (collision.posZ() < vertexZCut) { // For some reason declaring a filter doesnt work + return; + } fillMCPHistograms(jets, jetsWTA, particles); } PROCESS_SWITCH(hJetAnalysis, processMCP, "process MC particle level", false); @@ -462,6 +474,9 @@ struct hJetAnalysis { soa::Filtered> const& jetsWTA, JetParticles const& particles) { + if (collision.posZ() < vertexZCut) { + return; + } fillMCPHistograms(jets, jetsWTA, particles, collision.weight()); } PROCESS_SWITCH(hJetAnalysis, processMCPWeighted, "process MC particle level with event weights", false); From abcae7463d0a70f98ebf6d799a2c565cfeadadae Mon Sep 17 00:00:00 2001 From: JBae <110481228+joonsukbae@users.noreply.github.com> Date: Fri, 6 Sep 2024 07:05:45 +0200 Subject: [PATCH 38/60] PWGJE: constituent pT max cut (#7588) --- PWGJE/Tasks/jetfinderQA.cxx | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/PWGJE/Tasks/jetfinderQA.cxx b/PWGJE/Tasks/jetfinderQA.cxx index bbf588cee17..f4c08e6dbb6 100644 --- a/PWGJE/Tasks/jetfinderQA.cxx +++ b/PWGJE/Tasks/jetfinderQA.cxx @@ -66,6 +66,7 @@ struct JetFinderQATask { Configurable nBinsEta{"nBinsEta", 200, "number of bins for eta axes"}; Configurable jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; Configurable leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"}; + Configurable leadingConstituentPtMax{"leadingConstituentPtMax", 9999.0, "maximum pT selection on jet constituent"}; Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; Configurable checkMcCollisionIsMatched{"checkMcCollisionIsMatched", false, "0: count whole MCcollisions, 1: select MCcollisions which only have their correspond collisions"}; Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; @@ -333,18 +334,30 @@ struct JetFinderQATask { return false; } } - if (leadingConstituentPtMin > -98.0) { - bool isMinleadingConstituent = false; - for (auto& constituent : jet.template tracks_as()) { - if (constituent.pt() >= leadingConstituentPtMin) { - isMinleadingConstituent = true; - break; + bool checkConstituentPt = true; + bool checkConstituentMinPt = (leadingConstituentPtMin > -98.0); + bool checkConstituentMaxPt = (leadingConstituentPtMax < 9998.0); + if (!checkConstituentMinPt && !checkConstituentMaxPt) { + checkConstituentPt = false; + } + + if (checkConstituentPt) { + bool isMinLeadingConstituent = !checkConstituentMinPt; + bool isMaxLeadingConstituent = true; + + for (const auto& constituent : jet.template tracks_as()) { + double pt = constituent.pt(); + + if (checkConstituentMinPt && pt >= leadingConstituentPtMin) { + isMinLeadingConstituent = true; + } + if (checkConstituentMaxPt && pt > leadingConstituentPtMax) { + isMaxLeadingConstituent = false; } } - if (!isMinleadingConstituent) { - return false; - } + return isMinLeadingConstituent && isMaxLeadingConstituent; } + return true; } From 389373fab179cbe5755284e2b021b6a87a0cb49a Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:02:23 +0200 Subject: [PATCH 39/60] [PWGDQ] Implementing processes for skimmed data in tableMaker_withAssoc and bug fixes (#7579) * Implementing skimmed processes and muon bug fixes * Clang format --- .../TableProducer/tableMakerMC_withAssoc.cxx | 21 +++++-- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 58 ++++++++++++++++--- 2 files changed, 66 insertions(+), 13 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 4f2167ea835..d8ac99db3af 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -168,6 +168,8 @@ struct TableMakerMC { // 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"}; Service fCCDB; o2::ccdb::CcdbApi fCCDBApi; @@ -652,8 +654,8 @@ struct TableMakerMC { } } - template - void skimMuons(TEvent const& collision, TMuons const& muons, FwdTrackAssoc const& muonAssocs, aod::McParticles const& mcTracks, MFTTracks const& /*mftTracks*/) + template + void skimMuons(TEvent const& collision, TMuons const& muons, FwdTrackAssoc const& muonAssocs, aod::McParticles const& mcTracks, TMFTTracks const& /*mftTracks*/) { // Skim the fwd-tracks (muons) // Loop over the collision-track associations, recompute track properties depending on the collision assigned, and apply track cuts for selection @@ -672,6 +674,7 @@ struct TableMakerMC { auto muon = assoc.template fwdtrack_as(); trackFilteringTag = uint8_t(0); + trackTempFilterMap = uint8_t(0); 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 @@ -681,6 +684,9 @@ struct TableMakerMC { // recalculte pDca and global muon kinematics if (static_cast(muon.trackType()) < 2 && fRefitGlobalMuon) { auto muontrack = muon.template matchMCHTrack_as(); + if (muontrack.eta() < fMuonMatchEtaMin || muontrack.eta() > fMuonMatchEtaMax) { + continue; + } auto mfttrack = muon.template matchMFTTrack_as(); VarManager::FillTrackCollision(muontrack, collision); VarManager::FillGlobalMuonRefit(muontrack, mfttrack, collision); @@ -909,9 +915,14 @@ struct TableMakerMC { auto groupedMFTIndices = mftAssocs.sliceBy(mfttrackIndicesPerCollision, origIdx); skimMFT(collision, mftTracks, groupedMFTIndices); } - if constexpr (static_cast(TMuonFillMap) && static_cast(TMFTFillMap)) { - auto groupedMuonIndices = fwdTrackAssocs.sliceBy(fwdtrackIndicesPerCollision, origIdx); - skimMuons(collision, muons, groupedMuonIndices, mcParticles, mftTracks); + if constexpr (static_cast(TMuonFillMap)) { + if constexpr (static_cast(TMFTFillMap)) { + auto groupedMuonIndices = fwdTrackAssocs.sliceBy(fwdtrackIndicesPerCollision, origIdx); + skimMuons(collision, muons, groupedMuonIndices, mcParticles, mftTracks); + } else { + auto groupedMuonIndices = fwdTrackAssocs.sliceBy(fwdtrackIndicesPerCollision, origIdx); + skimMuons(collision, muons, groupedMuonIndices, mcParticles, nullptr); + } } } // end loop over skimmed collisions } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index c8489fe7c53..2ff783951d6 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -111,7 +111,8 @@ DECLARE_SOA_TABLE(AmbiguousTracksFwd, "AOD", "AMBIGUOUSFWDTR", //! Table for Fwd // 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 gkEventFillMapWithMult = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionMult; +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; constexpr static uint32_t gkEventFillMapWithMultsEventFilterZdc = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionMult | VarManager::ObjTypes::EventFilter | VarManager::ObjTypes::Zdc; // constexpr static uint32_t gkEventFillMapWithCent = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent; @@ -206,6 +207,8 @@ struct TableMaker { // 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"}; Service fCCDB; @@ -273,9 +276,9 @@ struct TableMaker { histClasses += "Event_AfterCuts;"; } - bool enableBarrelHistos = (context.mOptions.get("processPPWithFilter") || context.mOptions.get("processPPWithFilterBarrelOnly") || + 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") || + 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) { @@ -735,8 +738,8 @@ struct TableMaker { } } - template - void skimMuons(TEvent const& collision, TBCs const& /*bcs*/, TMuons const& muons, FwdTrackAssoc const& muonAssocs, MFTTracks const& /*mftTracks*/) + template + void skimMuons(TEvent const& collision, TBCs const& /*bcs*/, TMuons const& muons, FwdTrackAssoc const& muonAssocs, TMFTTracks const& /*mftTracks*/) { // Skim the fwd-tracks (muons) // Loop over the collision-track associations, recompute track properties depending on the collision assigned, and apply track cuts for selection @@ -754,6 +757,7 @@ struct TableMaker { auto muon = assoc.template fwdtrack_as(); trackFilteringTag = uint8_t(0); + trackTempFilterMap = uint8_t(0); 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 @@ -763,6 +767,9 @@ struct TableMaker { // recalculte pDca and global muon kinematics if (static_cast(muon.trackType()) < 2 && fRefitGlobalMuon) { auto muontrack = muon.template matchMCHTrack_as(); + if (muontrack.eta() < fMuonMatchEtaMin || muontrack.eta() > fMuonMatchEtaMax) { + continue; + } auto mfttrack = muon.template matchMFTTrack_as(); VarManager::FillTrackCollision(muontrack, collision); VarManager::FillGlobalMuonRefit(muontrack, mfttrack, collision); @@ -904,6 +911,10 @@ struct TableMaker { } // skim collisions + event.reserve(collisions.size()); + eventExtended.reserve(collisions.size()); + eventVtxCov.reserve(collisions.size()); + skimCollisions(collisions, bcs, zdcs, trackAssocs, tracksBarrel); if (fCollIndexMap.size() == 0) { return; @@ -948,9 +959,14 @@ struct TableMaker { auto groupedMFTIndices = mftAssocs.sliceBy(mfttrackIndicesPerCollision, origIdx); skimMFT(collision, bcs, mftTracks, groupedMFTIndices); } - if constexpr (static_cast(TMuonFillMap) && static_cast(TMFTFillMap)) { - auto groupedMuonIndices = fwdTrackAssocs.sliceBy(fwdtrackIndicesPerCollision, origIdx); - skimMuons(collision, bcs, muons, groupedMuonIndices, mftTracks); + if constexpr (static_cast(TMuonFillMap)) { + if constexpr (static_cast(TMFTFillMap)) { + auto groupedMuonIndices = fwdTrackAssocs.sliceBy(fwdtrackIndicesPerCollision, origIdx); + skimMuons(collision, bcs, muons, groupedMuonIndices, mftTracks); + } else { + auto groupedMuonIndices = fwdTrackAssocs.sliceBy(fwdtrackIndicesPerCollision, origIdx); + skimMuons(collision, bcs, muons, groupedMuonIndices, nullptr); + } } } // end loop over skimmed collisions } @@ -992,6 +1008,29 @@ struct TableMaker { fullSkimming(collisions, bcs, nullptr, nullptr, muons, mftTracks, nullptr, fwdTrackAssocs, mftAssocs); } + // produce the barrel-only DQ skimmed data model typically for pp/p-Pb or UPC Pb-Pb (no centrality), meant to run on skimmed data + void processPPBarrelOnly(MyEventsWithMults const& collisions, MyBCs const& bcs, aod::Zdcs& zdcs, + MyBarrelTracksWithCov const& tracksBarrel, + TrackAssoc const& trackAssocs) + { + fullSkimming(collisions, bcs, zdcs, tracksBarrel, nullptr, nullptr, trackAssocs, nullptr, nullptr); + } + + // 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) + { + fullSkimming(collisions, bcs, nullptr, nullptr, muons, nullptr, nullptr, fwdTrackAssocs, nullptr); + } + + // produce the muon+mft DQ skimmed data model typically for pp/p-Pb or UPC Pb-Pb (no centrality), meant to run on skimmed data + void processPPMuonMFT(MyEventsWithMults const& collisions, BCsWithTimestamps const& bcs, + MyMuonsWithCov const& muons, MFTTracks const& mftTracks, + FwdTrackAssoc const& fwdTrackAssocs, MFTTrackAssoc const& mftAssocs) + { + fullSkimming(collisions, bcs, nullptr, nullptr, muons, mftTracks, nullptr, fwdTrackAssocs, mftAssocs); + } + // produce the full DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter void processPbPb(MyEventsWithCentAndMults const& collisions, BCsWithTimestamps const& bcs, MyBarrelTracksWithCov const& tracksBarrel, @@ -1048,6 +1087,9 @@ struct TableMaker { PROCESS_SWITCH(TableMaker, processPPWithFilterBarrelOnly, "Build barrel only DQ skimmed data model typically for pp/p-Pb and UPC Pb-Pb, w/ event filtering", false); PROCESS_SWITCH(TableMaker, processPPWithFilterMuonOnly, "Build muon only DQ skimmed data model typically for pp/p-Pb and UPC Pb-Pb, w/ event filtering", false); PROCESS_SWITCH(TableMaker, processPPWithFilterMuonMFT, "Build muon + mft DQ skimmed data model typically for pp/p-Pb and UPC Pb-Pb, w/ event filtering", false); + PROCESS_SWITCH(TableMaker, processPPBarrelOnly, "Build barrel only DQ skimmed data model typically for pp/p-Pb and UPC Pb-Pb", false); + PROCESS_SWITCH(TableMaker, processPPMuonOnly, "Build muon only DQ skimmed data model typically for pp/p-Pb and UPC Pb-Pb", false); + PROCESS_SWITCH(TableMaker, processPPMuonMFT, "Build muon + mft DQ skimmed data model typically for pp/p-Pb and UPC Pb-Pb", false); 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); From a7c439c178d596cd5657126635022da089e17fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 6 Sep 2024 11:03:28 +0200 Subject: [PATCH 40/60] [TOF] switch based on coll system (#7580) --- Common/Core/CMakeLists.txt | 2 + Common/Core/CollisionTypeHelper.cxx | 58 +++ Common/Core/CollisionTypeHelper.h | 41 ++ Common/TableProducer/PID/pidTOFMerge.cxx | 605 ++++++++++++----------- 4 files changed, 420 insertions(+), 286 deletions(-) create mode 100644 Common/Core/CollisionTypeHelper.cxx create mode 100644 Common/Core/CollisionTypeHelper.h diff --git a/Common/Core/CMakeLists.txt b/Common/Core/CMakeLists.txt index 61ca933740c..9fcb1234de5 100644 --- a/Common/Core/CMakeLists.txt +++ b/Common/Core/CMakeLists.txt @@ -18,6 +18,7 @@ o2physics_add_library(AnalysisCore EventPlaneHelper.cxx TableHelper.cxx MetadataHelper.cxx + CollisionTypeHelper.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base) o2physics_target_root_dictionary(AnalysisCore @@ -31,4 +32,5 @@ o2physics_target_root_dictionary(AnalysisCore PID/DetectorResponse.h PID/PIDTOF.h PID/TPCPIDResponse.h + CollisionTypeHelper.h LINKDEF AnalysisCoreLinkDef.h) diff --git a/Common/Core/CollisionTypeHelper.cxx b/Common/Core/CollisionTypeHelper.cxx new file mode 100644 index 00000000000..1d4b383c7da --- /dev/null +++ b/Common/Core/CollisionTypeHelper.cxx @@ -0,0 +1,58 @@ +// 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 CollisionTypeHelper.h +/// \author Nicolò Jacazio nicolo.jacazio@cern.ch +/// \brief Utility to handle the collision type from the GRP information +/// + +#include "Common/Core/CollisionTypeHelper.h" +#include +#include +#include "DataFormatsParameters/GRPLHCIFData.h" + +std::string CollisionSystemType::getCollisionSystemName(collType collSys) +{ + switch (collSys) { + case kCollSyspp: + return "pp"; + case kCollSysPbPb: + return "PbPb"; + case kCollSysXeXe: + return "XeXe"; + case kCollSyspPb: + return "pPb"; + default: + LOG(fatal) << "Undefined collision system"; + return "Undefined"; + } +} + +int CollisionSystemType::getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif) +{ + const int ZBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA); + const int ZBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC); + switch (ZBeamA * ZBeamC) { + case 1: // pp 1*1 + return kCollSyspp; + case 6724: // Pb-Pb 82*82 + return kCollSysPbPb; + case 225: // Xe-Xe 54*54 + return kCollSysXeXe; + case 82: // p-Pb 82*1 + return kCollSyspPb; + default: + LOG(fatal) << "Undefined collision system"; + return kCollSysUndef; + } + return kCollSysUndef; +} diff --git a/Common/Core/CollisionTypeHelper.h b/Common/Core/CollisionTypeHelper.h new file mode 100644 index 00000000000..0196fdc03bb --- /dev/null +++ b/Common/Core/CollisionTypeHelper.h @@ -0,0 +1,41 @@ +// 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 CollisionTypeHelper.h +/// \author Nicolò Jacazio nicolo.jacazio@cern.ch +/// \brief Utility to handle the collision type from the GRP information +/// + +#ifndef COMMON_CORE_COLLISIONTYPEHELPER_H_ +#define COMMON_CORE_COLLISIONTYPEHELPER_H_ + +#include +#include "DataFormatsParameters/GRPLHCIFData.h" + +// Container for the collision system type +struct CollisionSystemType { + // Enum type for the collision system + typedef int collType; + + static constexpr collType kCollSysUndef = -1; // Undefined collision system + static constexpr collType kCollSyspp = 0; // pp + static constexpr collType kCollSysPbPb = 1; // PbPb + static constexpr collType kCollSysXeXe = 2; // XeXe + static constexpr collType kCollSyspPb = 3; // pPb + static constexpr collType kNCollSys = 4; // Number of collision systems + + static std::string getCollisionSystemName(collType collSys); + + static int getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif); +}; + +#endif // COMMON_CORE_COLLISIONTYPEHELPER_H_ diff --git a/Common/TableProducer/PID/pidTOFMerge.cxx b/Common/TableProducer/PID/pidTOFMerge.cxx index 51343f328cb..df746fc6a94 100644 --- a/Common/TableProducer/PID/pidTOFMerge.cxx +++ b/Common/TableProducer/PID/pidTOFMerge.cxx @@ -31,6 +31,7 @@ // O2Physics includes #include "TableHelper.h" #include "MetadataHelper.h" +#include "CollisionTypeHelper.h" #include "pidTOFBase.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" @@ -45,114 +46,142 @@ using namespace o2::track; MetadataHelper metadataInfo; +// Input data types +using Run3Trks = o2::soa::Join; +using Run3Cols = aod::Collisions; +using Run3TrksWtof = soa::Join; +using Run3TrksWtofWevTime = soa::Join; + +using EvTimeCollisions = soa::Join; +using EvTimeCollisionsFT0 = soa::Join; + +using Run2Trks = o2::soa::Join; +using Run2TrksWtofWevTime = soa::Join; + // Configuration common to all tasks struct TOFCalibConfig : ConfigurableGroup { - Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable timestamp{"ccdb-timestamp", -1, "timestamp of the object"}; - Configurable timeShiftCCDBPath{"timeShiftCCDBPath", "", "Path of the TOF time shift vs eta. If empty none is taken"}; - Configurable paramFileName{"paramFileName", "", "Path to the parametrization object. If empty the parametrization is not taken from file"}; - Configurable parametrizationPath{"parametrizationPath", "TOF/Calib/Params", "Path of the TOF parametrization on the CCDB or in the file, if the paramFileName is not empty"}; - Configurable passName{"passName", "", "Name of the pass inside of the CCDB parameter collection. If empty, the automatically deceted from metadata (to be implemented!!!)"}; - 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"}; - - void inheritFromBaseTask(o2::framework::InitContext& initContext) - { - if (!getTaskOptionValue(initContext, "tof-signal", "ccdb-url", url.value, true)) { - LOG(fatal) << "Could not get ccdb-url from tof-signal task"; - } - if (!getTaskOptionValue(initContext, "tof-signal", "ccdb-timestamp", timestamp.value, true)) { - LOG(fatal) << "Could not get ccdb-timestamp from tof-signal task"; - } - if (!getTaskOptionValue(initContext, "tof-signal", "paramFileName", paramFileName.value, true)) { - LOG(fatal) << "Could not get paramFileName from tof-signal task"; - } - if (!getTaskOptionValue(initContext, "tof-signal", "parametrizationPath", parametrizationPath.value, true)) { - LOG(fatal) << "Could not get parametrizationPath from tof-signal task"; - } - if (!getTaskOptionValue(initContext, "tof-signal", "passName", passName.value, true)) { - LOG(fatal) << "Could not get passName from tof-signal task"; - } - if (!getTaskOptionValue(initContext, "tof-signal", "timeShiftCCDBPath", timeShiftCCDBPath.value, true)) { - LOG(fatal) << "Could not get timeShiftCCDBPath from tof-signal task"; - } - if (!getTaskOptionValue(initContext, "tof-signal", "loadResponseFromCCDB", loadResponseFromCCDB.value, true)) { - LOG(fatal) << "Could not get loadResponseFromCCDB from tof-signal task"; - } - if (!getTaskOptionValue(initContext, "tof-signal", "fatalOnPassNotAvailable", fatalOnPassNotAvailable.value, true)) { - LOG(fatal) << "Could not get fatalOnPassNotAvailable from tof-signal task"; - } - } - + // Configurable options + Configurable mUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable mPathGrpLhcIf{"ccdb-path-grplhcif", "GLO/Config/GRPLHCIF", "Path on the CCDB for the GRPLHCIF object"}; + Configurable mTimestamp{"ccdb-timestamp", -1, "timestamp of the object"}; + Configurable mTimeShiftCCDBPath{"timeShiftCCDBPath", "", "Path of the TOF time shift vs eta. If empty none is taken"}; + Configurable mParamFileName{"paramFileName", "", "Path to the parametrization object. If empty the parametrization is not taken from file"}; + Configurable mParametrizationPath{"parametrizationPath", "TOF/Calib/Params", "Path of the TOF parametrization on the CCDB or in the file, if the paramFileName is not empty"}; + Configurable mReconstructionPass{"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 mLoadResponseFromCCDB{"loadResponseFromCCDB", false, "Flag to load the response from the CCDB"}; + Configurable mFatalOnPassNotAvailable{"fatalOnPassNotAvailable", true, "Flag to throw a fatal if the pass is not available in the retrieved CCDB object"}; + Configurable mEnableTimeDependentResponse{"enableTimeDependentResponse", false, "Flag to use the collision timestamp to fetch the PID Response"}; + Configurable mCollisionSystem{"collisionSystem", -1, "Collision system: -1 (autoset), 0 (pp), 1 (PbPb), 2 (XeXe), 3 (pPb)"}; + Configurable mAutoSetProcessFunctions{"mAutoSetProcessFunctions", true, "Flag to autodetect the process functions to use"}; + + // @brief Set up the configuration from the calibration object from the init function of the task template - void setUp(o2::pid::tof::TOFResoParamsV3& mRespParamsV3, CCDBObject ccdb) + void initSetup(o2::pid::tof::TOFResoParamsV3& mRespParamsV3, + CCDBObject ccdb) { // First we set the CCDB manager - ccdb->setURL(url.value); - ccdb->setTimestamp(timestamp.value); + ccdb->setURL(mUrl.value); + ccdb->setTimestamp(mTimestamp.value); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); // Not later than now objects ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); // Then the information about the metadata - if (passName.value == "metadata") { + if (mReconstructionPass.value == "metadata") { LOG(info) << "Getting pass from metadata"; if (metadataInfo.isMC()) { - passName.value = metadataInfo.get("AnchorPassName"); + mReconstructionPass.value = metadataInfo.get("AnchorPassName"); } else { - passName.value = metadataInfo.get("RecoPassName"); + mReconstructionPass.value = metadataInfo.get("RecoPassName"); } - LOG(info) << "Passed autodetect mode for pass. Taking '" << passName.value << "'"; + LOG(info) << "Passed autodetect mode for pass. Taking '" << mReconstructionPass.value << "'"; } - LOG(info) << "Using parameter collection, starting from pass '" << passName.value << "'"; + LOG(info) << "Using parameter collection, starting from pass '" << mReconstructionPass.value << "'"; - const std::string fname = paramFileName.value; + const std::string fname = mParamFileName.value; if (!fname.empty()) { // Loading the parametrization from file - LOG(info) << "Loading exp. sigma parametrization from file " << fname << ", using param: " << parametrizationPath.value; + LOG(info) << "Loading exp. sigma parametrization from file " << fname << ", using param: " << mParametrizationPath.value; if (1) { o2::tof::ParameterCollection paramCollection; - paramCollection.loadParamFromFile(fname, parametrizationPath.value); + paramCollection.loadParamFromFile(fname, mParametrizationPath.value); LOG(info) << "+++ Loaded parameter collection from file +++"; - if (!paramCollection.retrieveParameters(mRespParamsV3, passName.value)) { - if (fatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", passName.value.data()); + if (!paramCollection.retrieveParameters(mRespParamsV3, mReconstructionPass.value)) { + if (mFatalOnPassNotAvailable) { + LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.value.data()); } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", passName.value.data()); + LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.value.data()); } } else { - mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(passName.value)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass.value)); mRespParamsV3.printMomentumChargeShiftParameters(); } } else { - mRespParamsV3.loadParamFromFile(fname.data(), parametrizationPath.value); + mRespParamsV3.loadParamFromFile(fname.data(), mParametrizationPath.value); } - } else if (loadResponseFromCCDB) { // Loading it from CCDB - LOG(info) << "Loading exp. sigma parametrization from CCDB, using path: " << parametrizationPath.value << " for timestamp " << timestamp.value; - o2::tof::ParameterCollection* paramCollection = ccdb->template getForTimeStamp(parametrizationPath.value, timestamp.value); + } else if (mLoadResponseFromCCDB) { // Loading it from CCDB + LOG(info) << "Loading exp. sigma parametrization from CCDB, using path: " << mParametrizationPath.value << " for timestamp " << mTimestamp.value; + o2::tof::ParameterCollection* paramCollection = ccdb->template getForTimeStamp(mParametrizationPath.value, mTimestamp.value); paramCollection->print(); - if (!paramCollection->retrieveParameters(mRespParamsV3, passName.value)) { // Attempt at loading the parameters with the pass defined - if (fatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", passName.value.data()); + if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPass.value)) { // Attempt at loading the parameters with the pass defined + if (mFatalOnPassNotAvailable) { + LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.value.data()); } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", passName.value.data()); + LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.value.data()); } } else { // Pass is available, load non standard parameters - mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(passName.value)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass.value)); mRespParamsV3.printMomentumChargeShiftParameters(); } } + // Calibration object is defined mRespParamsV3.print(); - if (timeShiftCCDBPath.value != "") { - if (timeShiftCCDBPath.value.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(timeShiftCCDBPath.value, "gmean_Pos", true); - mRespParamsV3.setTimeShiftParameters(timeShiftCCDBPath.value, "gmean_Neg", false); + + // Loading additional calibration objects + if (mTimeShiftCCDBPath.value != "") { + if (mTimeShiftCCDBPath.value.find(".root") != std::string::npos) { + mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPath.value, "gmean_Pos", true); + mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPath.value, "gmean_Neg", false); } else { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(Form("%s/pos", timeShiftCCDBPath.value.c_str()), timestamp.value), true); - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(Form("%s/neg", timeShiftCCDBPath.value.c_str()), timestamp.value), false); + mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(Form("%s/pos", mTimeShiftCCDBPath.value.c_str()), mTimestamp.value), true); + mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(Form("%s/neg", mTimeShiftCCDBPath.value.c_str()), mTimestamp.value), false); } } } + + template + void processSetup(o2::pid::tof::TOFResoParamsV3& mRespParamsV3, + CCDBObject ccdb, + const BcType& bc) + { + // First we check if this run number was already processed + if (mLastRunNumber == bc.runNumber()) { + return; + } + mLastRunNumber = bc.runNumber(); + mTimestamp.value = bc.timestamp(); + + // Check the beam type + o2::parameters::GRPLHCIFData* grpo = ccdb->template getForTimeStamp(mPathGrpLhcIf.value, + mTimestamp.value); + mCollisionSystem.value = CollisionSystemType::getCollisionTypeFromGrp(grpo); + + if (!mEnableTimeDependentResponse) { + return; + } + LOG(debug) << "Updating parametrization from path '" << mParametrizationPath.value << "' and timestamp " << mTimestamp.value; + if (!ccdb->template getForTimeStamp(mParametrizationPath.value, mTimestamp.value)->retrieveParameters(mRespParamsV3, mReconstructionPass.value)) { + if (mFatalOnPassNotAvailable) { + LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.value.data()); + } else { + LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.value.data()); + } + } + return; + } + + private: + int mLastRunNumber = -1; // Last run number for which the calibration was loaded }; // Part 1 TOF signal definition @@ -161,8 +190,6 @@ struct TOFCalibConfig : ConfigurableGroup { float trackDistanceForGoodMatch = 999.f; float trackDistanceForGoodMatchLowMult = 999.f; int multiplicityThreshold = 0; -using Run3Trks = o2::soa::Join; -using Run3Cols = aod::Collisions; bool isTrackGoodMatchForTOFPID(const Run3Trks::iterator& tr, const Run3Cols& /*ev*/) { if (!tr.hasTOF()) { @@ -204,11 +231,14 @@ struct tofSignal { LOG(info) << "No table or process is enabled. Disabling task"; return; } - if (metadataInfo.isFullyDefined() && !doprocessRun2 && !doprocessRun3) { // Check if the metadata is initialized (only if not forced from the workflow configuration) - if (metadataInfo.isRun3()) { - doprocessRun3.value = true; - } else { - doprocessRun2.value = false; + if (mTOFCalibConfig.mAutoSetProcessFunctions) { + LOG(info) << "Autodetecting process functions"; + if (metadataInfo.isFullyDefined() && !doprocessRun2 && !doprocessRun3) { // Check if the metadata is initialized (only if not forced from the workflow configuration) + if (metadataInfo.isRun3()) { + doprocessRun3.value = true; + } else { + doprocessRun2.value = false; + } } } @@ -263,8 +293,7 @@ struct tofSignal { } PROCESS_SWITCH(tofSignal, processRun3, "Process Run3 data i.e. input is TrackIU. Set to false to autodetect from metadata.", false); - using TrksRun2 = o2::soa::Join; - void processRun2(TrksRun2 const& tracks) + void processRun2(Run2Trks const& tracks) { if (!enableTableTOFSignal) { return; @@ -274,7 +303,7 @@ struct tofSignal { tableFlags.reserve(tracks.size()); } for (auto& t : tracks) { - table(o2::pid::tof::TOFSignal::GetTOFSignal(t)); + table(o2::pid::tof::TOFSignal::GetTOFSignal(t)); if (!enableTablepidTOFFlags) { continue; } @@ -290,7 +319,11 @@ float trackSampleMaxMomentum = 2.f; template bool filterForTOFEventTime(const trackType& tr) { - return (tr.hasTOF() && tr.p() > trackSampleMinMomentum && tr.p() < trackSampleMaxMomentum && tr.hasITS() && tr.hasTPC() && (tr.trackType() == o2::aod::track::TrackTypeEnum::Track || tr.trackType() == o2::aod::track::TrackTypeEnum::TrackIU)); + return (tr.hasTOF() && + tr.p() > trackSampleMinMomentum && tr.p() < trackSampleMaxMomentum && + tr.hasITS() && + tr.hasTPC() && + (tr.trackType() == o2::aod::track::TrackTypeEnum::Track || tr.trackType() == o2::aod::track::TrackTypeEnum::TrackIU)); } // accept all /// Specialization of TOF event time maker @@ -331,6 +364,8 @@ struct tofEventTime { Configurable maxMomentum{"maxMomentum", 2.0f, "Maximum momentum to select track sample for TOF event time"}; Configurable maxEvTimeTOF{"maxEvTimeTOF", 100000.0f, "Maximum value of the TOF event time"}; Configurable sel8TOFEvTime{"sel8TOFEvTime", false, "Flag to compute the ev. time only for events that pass the sel8 ev. selection"}; + Configurable mComputeEvTimeWithTOF{"computeEvTimeWithTOF", -1, "Compute ev. time with TOF. -1 (autoset), 0 no, 1 yes"}; + Configurable mComputeEvTimeWithFT0{"computeEvTimeWithFT0", -1, "Compute ev. time with FT0. -1 (autoset), 0 no, 1 yes"}; Configurable maxNtracksInSet{"maxNtracksInSet", 10, "Size of the set to consider for the TOF ev. time computation"}; void init(o2::framework::InitContext& initContext) @@ -353,8 +388,24 @@ struct tofEventTime { return; } - if (metadataInfo.isFullyDefined() && metadataInfo.isRun3() && doprocessRun2) { - LOG(fatal) << "Run2 process function is enabled but the metadata says it is Run3"; + if (mTOFCalibConfig.mAutoSetProcessFunctions) { + LOG(info) << "Autodetecting process functions"; + if (metadataInfo.isFullyDefined()) { + if (metadataInfo.isRun3()) { + doprocessRun3.value = true; + } else { + doprocessRun2.value = true; + } + } + } + + if (metadataInfo.isFullyDefined()) { + if (metadataInfo.isRun3() && doprocessRun2) { + LOG(fatal) << "Run2 process function is enabled but the metadata says it is Run3"; + } + if (!metadataInfo.isRun3() && doprocessRun3) { + LOG(fatal) << "Run3 process function is enabled but the metadata says it is Run2"; + } } trackSampleMinMomentum = minMomentum; @@ -366,16 +417,8 @@ struct tofEventTime { LOGF(info, "Enabling process function: processRun2"); nEnabled++; } - if (doprocessNoFT0 == true) { - LOGF(info, "Enabling process function: processNoFT0"); - nEnabled++; - } - if (doprocessFT0 == true) { - LOGF(info, "Enabling process function: processFT0"); - nEnabled++; - } - if (doprocessOnlyFT0 == true) { - LOGF(info, "Enabling process function: processOnlyFT0"); + if (doprocessRun3 == true) { + LOGF(info, "Enabling process function: processRun3"); nEnabled++; } if (nEnabled > 1) { @@ -385,7 +428,7 @@ struct tofEventTime { if (sel8TOFEvTime.value == true) { LOG(info) << "TOF event time will be computed for collisions that pass the event selection only!"; } - mTOFCalibConfig.setUp(mRespParamsV3, ccdb); // Getting the parametrization parameters + mTOFCalibConfig.initSetup(mRespParamsV3, ccdb); // Getting the parametrization parameters o2::tof::eventTimeContainer::setMaxNtracksInSet(maxNtracksInSet.value); o2::tof::eventTimeContainer::printConfig(); @@ -415,22 +458,23 @@ struct tofEventTime { tableEvTime(t.collision().collisionTime() * 1000.f, t.collision().collisionTimeRes() * 1000.f); } } - PROCESS_SWITCH(tofEventTime, processRun2, "Process with Run2 data", false); + PROCESS_SWITCH(tofEventTime, processRun2, "Process with Run2 data", true); /// /// Process function to prepare the event for each track on Run 3 data without the FT0 - using TrksEvTime = soa::Join; // Define slice per collision - Preslice perCollision = aod::track::collisionId; + Preslice perCollision = aod::track::collisionId; template - using ResponseImplementationEvTime = o2::pid::tof::ExpTimes; - using EvTimeCollisions = soa::Join; - void processNoFT0(TrksEvTime const& tracks, - EvTimeCollisions const&) + using ResponseImplementationEvTime = o2::pid::tof::ExpTimes; + void processRun3(Run3TrksWtof& tracks, + aod::FT0s const&, + EvTimeCollisionsFT0 const&, + aod::BCsWithTimestamps const&) { if (!enableTableTOFEvTime) { return; } + LOG(debug) << "Processing Run3 data for TOF event time"; tableEvTime.reserve(tracks.size()); tableFlags.reserve(tracks.size()); @@ -438,187 +482,181 @@ struct tofEventTime { tableEvTimeTOFOnly.reserve(tracks.size()); } - int lastCollisionId = -1; // Last collision ID analysed - for (auto const& t : tracks) { // Loop on collisions - if (!t.has_collision() || ((sel8TOFEvTime.value == true) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection - tableFlags(0); - tableEvTime(0.f, 999.f); - if (enableTableEvTimeTOFOnly) { - tableEvTimeTOFOnly((uint8_t)0, 0.f, 0.f, -1); - } + for (auto const& track : tracks) { // Loop on all tracks + if (!track.has_collision()) { // Skipping tracks without collisions continue; } - if (t.collisionId() == lastCollisionId) { // Event time from this collision is already in the table + const auto& coll = track.collision_as(); + if (!coll.has_bc()) { continue; } - /// Create new table for the tracks in a collision - lastCollisionId = t.collisionId(); /// Cache last collision ID - - const auto& tracksInCollision = tracks.sliceBy(perCollision, lastCollisionId); + mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as()); // Update the calibration parameters + } - // First make table for event time - const auto evTimeTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, diamond); - int nGoodTracksForTOF = 0; - float et = evTimeTOF.mEventTime; - float erret = evTimeTOF.mEventTimeError; + // Autoset the processing mode for the event time computation + switch (mTOFCalibConfig.mCollisionSystem.value) { + 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.mCollisionSystem.value << " " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.mCollisionSystem) << " not supported for TOF event time computation"; + break; + } + LOG(debug) << "Running on " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.mCollisionSystem) << " mComputeEvTimeWithTOF " << mComputeEvTimeWithTOF.value << " mComputeEvTimeWithFT0 " << mComputeEvTimeWithFT0.value; - for (auto const& trk : tracksInCollision) { // Loop on Tracks - if constexpr (removeTOFEvTimeBias) { - evTimeTOF.removeBias(trk, nGoodTracksForTOF, et, erret, 2); - } - uint8_t flags = 0; - if (erret < errDiamond && (maxEvTimeTOF <= 0.f || abs(et) < maxEvTimeTOF)) { - flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; - } else { - et = 0.f; - erret = errDiamond; + if (mComputeEvTimeWithTOF == 1 && mComputeEvTimeWithFT0 == 1) { + int lastCollisionId = -1; // Last collision ID analysed + for (auto const& t : tracks) { // Loop on collisions + if (!t.has_collision() || ((sel8TOFEvTime.value == true) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection + tableFlags(0); + tableEvTime(0.f, 999.f); + if (enableTableEvTimeTOFOnly) { + tableEvTimeTOFOnly((uint8_t)0, 0.f, 0.f, -1); + } + continue; } - tableFlags(flags); - tableEvTime(et, erret); - if (enableTableEvTimeTOFOnly) { - tableEvTimeTOFOnly((uint8_t)filterForTOFEventTime(trk), et, erret, evTimeTOF.mEventTimeMultiplicity); + if (t.collisionId() == lastCollisionId) { // Event time from this collision is already in the table + continue; } - } - } - } - PROCESS_SWITCH(tofEventTime, processNoFT0, "Process without FT0", false); + /// Create new table for the tracks in a collision + lastCollisionId = t.collisionId(); /// Cache last collision ID - /// - /// Process function to prepare the event for each track on Run 3 data with the FT0 - using EvTimeCollisionsFT0 = soa::Join; - void processFT0(TrksEvTime& tracks, - aod::FT0s const&, - EvTimeCollisionsFT0 const&) - { - if (!enableTableTOFEvTime) { - return; - } + const auto& tracksInCollision = tracks.sliceBy(perCollision, lastCollisionId); + const auto& collision = t.collision_as(); - tableEvTime.reserve(tracks.size()); - tableFlags.reserve(tracks.size()); - if (enableTableEvTimeTOFOnly) { - tableEvTimeTOFOnly.reserve(tracks.size()); - } + // Compute the TOF event time + const auto evTimeMakerTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, diamond); - int lastCollisionId = -1; // Last collision ID analysed - for (auto const& t : tracks) { // Loop on collisions - if (!t.has_collision() || ((sel8TOFEvTime.value == true) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection - tableFlags(0); - tableEvTime(0.f, 999.f); - if (enableTableEvTimeTOFOnly) { - tableEvTimeTOFOnly((uint8_t)0, 0.f, 0.f, -1); - } - continue; - } - if (t.collisionId() == lastCollisionId) { // Event time from this collision is already in the table - continue; - } - /// Create new table for the tracks in a collision - lastCollisionId = t.collisionId(); /// Cache last collision ID - - const auto& tracksInCollision = tracks.sliceBy(perCollision, lastCollisionId); - const auto& collision = t.collision_as(); - - // Compute the TOF event time - const auto evTimeTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, diamond); - - float t0AC[2] = {.0f, 999.f}; // Value and error of T0A or T0C or T0AC - float t0TOF[2] = {static_cast(evTimeTOF.mEventTime), static_cast(evTimeTOF.mEventTimeError)}; // Value and error of TOF - - uint8_t flags = 0; - int nGoodTracksForTOF = 0; - float eventTime = 0.f; - float sumOfWeights = 0.f; - float weight = 0.f; - - for (auto const& trk : tracksInCollision) { // Loop on Tracks - // Reset the flag - flags = 0; - // Reset the event time - eventTime = 0.f; - sumOfWeights = 0.f; - weight = 0.f; - // Remove the bias on TOF ev. time - if constexpr (removeTOFEvTimeBias) { - evTimeTOF.removeBias(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2); - } - if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || abs(t0TOF[0]) < maxEvTimeTOF)) { - flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; + float t0AC[2] = {.0f, 999.f}; // Value and error of T0A or T0C or T0AC + float t0TOF[2] = {static_cast(evTimeMakerTOF.mEventTime), static_cast(evTimeMakerTOF.mEventTimeError)}; // Value and error of TOF - weight = 1.f / (t0TOF[1] * t0TOF[1]); - eventTime += t0TOF[0] * weight; - sumOfWeights += weight; - } + uint8_t flags = 0; + int nGoodTracksForTOF = 0; + float eventTime = 0.f; + float sumOfWeights = 0.f; + float weight = 0.f; + + for (auto const& trk : tracksInCollision) { // Loop on Tracks + // Reset the flag + flags = 0; + // Reset the event time + eventTime = 0.f; + sumOfWeights = 0.f; + weight = 0.f; + // Remove the bias on TOF ev. time + if constexpr (removeTOFEvTimeBias) { + evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2); + } + if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || abs(t0TOF[0]) < maxEvTimeTOF)) { + flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; - if (collision.has_foundFT0()) { // T0 measurement is available - // const auto& ft0 = collision.foundFT0(); - if (collision.t0ACValid()) { - t0AC[0] = collision.t0AC() * 1000.f; - t0AC[1] = collision.t0resolution() * 1000.f; - flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeT0AC; + weight = 1.f / (t0TOF[1] * t0TOF[1]); + eventTime += t0TOF[0] * weight; + sumOfWeights += weight; } - weight = 1.f / (t0AC[1] * t0AC[1]); - eventTime += t0AC[0] * weight; - sumOfWeights += weight; - } + if (collision.has_foundFT0()) { // T0 measurement is available + // const auto& ft0 = collision.foundFT0(); + if (collision.t0ACValid()) { + t0AC[0] = collision.t0AC() * 1000.f; + t0AC[1] = collision.t0resolution() * 1000.f; + flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeT0AC; + } + + weight = 1.f / (t0AC[1] * t0AC[1]); + eventTime += t0AC[0] * weight; + sumOfWeights += weight; + } - if (sumOfWeights < weightDiamond) { // avoiding sumOfWeights = 0 or worse that diamond - eventTime = 0; - sumOfWeights = weightDiamond; + if (sumOfWeights < weightDiamond) { // avoiding sumOfWeights = 0 or worse that diamond + eventTime = 0; + sumOfWeights = weightDiamond; + tableFlags(0); + } else { + tableFlags(flags); + } + tableEvTime(eventTime / sumOfWeights, sqrt(1. / sumOfWeights)); + if (enableTableEvTimeTOFOnly) { + tableEvTimeTOFOnly((uint8_t)filterForTOFEventTime(trk), t0TOF[0], t0TOF[1], evTimeMakerTOF.mEventTimeMultiplicity); + } + } + } + } else if (mComputeEvTimeWithTOF == 1 && mComputeEvTimeWithFT0 == 0) { + int lastCollisionId = -1; // Last collision ID analysed + for (auto const& t : tracks) { // Loop on collisions + if (!t.has_collision() || ((sel8TOFEvTime.value == true) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection tableFlags(0); - } else { - tableFlags(flags); + tableEvTime(0.f, 999.f); + if (enableTableEvTimeTOFOnly) { + tableEvTimeTOFOnly((uint8_t)0, 0.f, 0.f, -1); + } + continue; } - tableEvTime(eventTime / sumOfWeights, sqrt(1. / sumOfWeights)); - if (enableTableEvTimeTOFOnly) { - tableEvTimeTOFOnly((uint8_t)filterForTOFEventTime(trk), t0TOF[0], t0TOF[1], evTimeTOF.mEventTimeMultiplicity); + if (t.collisionId() == lastCollisionId) { // Event time from this collision is already in the table + continue; } - } - } - } - PROCESS_SWITCH(tofEventTime, processFT0, "Process with FT0", false); + /// Create new table for the tracks in a collision + lastCollisionId = t.collisionId(); /// Cache last collision ID - /// - /// Process function to prepare the event for each track on Run 3 data with only the FT0 - void processOnlyFT0(TrksEvTime& tracks, - aod::FT0s const&, - EvTimeCollisionsFT0 const&) - { - if (!enableTableTOFEvTime) { - return; - } + const auto& tracksInCollision = tracks.sliceBy(perCollision, lastCollisionId); - tableEvTime.reserve(tracks.size()); - tableFlags.reserve(tracks.size()); - if (!enableTableEvTimeTOFOnly) { - tableEvTimeTOFOnly.reserve(tracks.size()); - } + // First make table for event time + const auto evTimeMakerTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, diamond); + int nGoodTracksForTOF = 0; + float et = evTimeMakerTOF.mEventTime; + float erret = evTimeMakerTOF.mEventTimeError; - for (auto const& t : tracks) { // Loop on collisions - if (enableTableEvTimeTOFOnly) { - tableEvTimeTOFOnly((uint8_t)0, 0.f, 0.f, -1); - } - if (!t.has_collision()) { // Track was not assigned, cannot compute event time - tableFlags(0); - tableEvTime(0.f, 999.f); - continue; + for (auto const& trk : tracksInCollision) { // Loop on Tracks + if constexpr (removeTOFEvTimeBias) { + evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, et, erret, 2); + } + uint8_t flags = 0; + if (erret < errDiamond && (maxEvTimeTOF <= 0.f || abs(et) < maxEvTimeTOF)) { + flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; + } else { + et = 0.f; + erret = errDiamond; + } + tableFlags(flags); + tableEvTime(et, erret); + if (enableTableEvTimeTOFOnly) { + tableEvTimeTOFOnly((uint8_t)filterForTOFEventTime(trk), et, erret, evTimeMakerTOF.mEventTimeMultiplicity); + } + } } - const auto& collision = t.collision_as(); - - if (collision.has_foundFT0()) { // T0 measurement is available - // const auto& ft0 = collision.foundFT0(); - if (collision.t0ACValid()) { - tableFlags(o2::aod::pidflags::enums::PIDFlags::EvTimeT0AC); - tableEvTime(collision.t0AC() * 1000.f, collision.t0resolution() * 1000.f); + } else if (mComputeEvTimeWithTOF == 0 && mComputeEvTimeWithFT0 == 1) { + for (auto const& t : tracks) { // Loop on collisions + if (enableTableEvTimeTOFOnly) { + tableEvTimeTOFOnly((uint8_t)0, 0.f, 0.f, -1); + } + if (!t.has_collision()) { // Track was not assigned, cannot compute event time + tableFlags(0); + tableEvTime(0.f, 999.f); continue; } + const auto& collision = t.collision_as(); + + if (collision.has_foundFT0()) { // T0 measurement is available + // const auto& ft0 = collision.foundFT0(); + if (collision.t0ACValid()) { + tableFlags(o2::aod::pidflags::enums::PIDFlags::EvTimeT0AC); + tableEvTime(collision.t0AC() * 1000.f, collision.t0resolution() * 1000.f); + continue; + } + } + tableFlags(0); + tableEvTime(0.f, 999.f); } - tableFlags(0); - tableEvTime(0.f, 999.f); + } else { + LOG(fatal) << "Invalid configuration for TOF event time computation"; } } - PROCESS_SWITCH(tofEventTime, processOnlyFT0, "Process only with FT0", false); + PROCESS_SWITCH(tofEventTime, processRun3, "Process the Run3 data", true); }; // Part 3 Nsigma computation @@ -675,7 +713,6 @@ struct tofPidMerge { TOFCalibConfig mTOFCalibConfig; // TOF Calib configuration // Configurable inheritFromBaseTask{"inheritFromBaseTask", true, "Flag to iherit all common configurables from the TOF base task"}; Configurable enableQaHistograms{"enableQaHistograms", false, "Flag to enable the QA histograms"}; - Configurable enableTimeDependentResponse{"enableTimeDependentResponse", false, "Flag to use the collision timestamp to fetch the PID Response"}; // Configuration flags to include and exclude particle hypotheses Configurable> enableParticle{"enableParticle", @@ -716,7 +753,7 @@ struct tofPidMerge { } else if (doprocessData.value == false) { LOG(fatal) << "PID tables are required but process data is disabled. Please enable it"; } - mTOFCalibConfig.setUp(mRespParamsV3, ccdb); // Getting the parametrization parameters + mTOFCalibConfig.initSetup(mRespParamsV3, ccdb); // Getting the parametrization parameters // Printing enabled tables and enabling QA histograms if needed LOG(info) << "++ Enabled tables:"; @@ -904,10 +941,11 @@ struct tofPidMerge { void process(aod::BCs const&) {} - using Trks = soa::Join; template - using ResponseImplementation = o2::pid::tof::ExpTimes; - void processData(Trks const& tracks, aod::Collisions const&, aod::BCsWithTimestamps const&) + using ResponseImplementation = o2::pid::tof::ExpTimes; + void processData(Run3TrksWtofWevTime const& tracks, + Run3Cols const&, + aod::BCsWithTimestamps const&) { constexpr auto responseEl = ResponseImplementation(); constexpr auto responseMu = ResponseImplementation(); @@ -923,18 +961,11 @@ struct tofPidMerge { if (!track.has_collision()) { // Skipping tracks without collisions continue; } - mTOFCalibConfig.timestamp.value = track.collision().bc_as().timestamp(); - if (enableTimeDependentResponse) { - LOG(debug) << "Updating parametrization from path '" << mTOFCalibConfig.parametrizationPath.value << "' and timestamp " << mTOFCalibConfig.timestamp.value; - if (!ccdb->getForTimeStamp(mTOFCalibConfig.parametrizationPath.value, mTOFCalibConfig.timestamp.value)->retrieveParameters(mRespParamsV3, mTOFCalibConfig.passName.value)) { - if (mTOFCalibConfig.fatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mTOFCalibConfig.passName.value.data()); - } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mTOFCalibConfig.passName.value.data()); - } - } + const auto& coll = track.collision(); + if (!coll.has_bc()) { + continue; } - break; + mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as()); // Update the calibration parameters } for (auto const& pidId : mEnabledParticles) { @@ -1104,11 +1135,15 @@ struct tofPidBeta { LOG(info) << "No table or process is enabled. Disabling task"; return; } - if (metadataInfo.isFullyDefined()) { - if (metadataInfo.isRun3()) { - doprocessRun3.value = true; - } else { - doprocessRun2.value = true; + + if (mTOFCalibConfig.mAutoSetProcessFunctions) { + LOG(info) << "Autodetecting process functions"; + if (metadataInfo.isFullyDefined()) { + if (metadataInfo.isRun3()) { + doprocessRun3.value = true; + } else { + doprocessRun2.value = true; + } } } @@ -1116,14 +1151,13 @@ struct tofPidBeta { if (!enableTOFParams) { return; } - mTOFCalibConfig.setUp(mRespParamsV3, ccdb); // Getting the parametrization parameters + mTOFCalibConfig.initSetup(mRespParamsV3, ccdb); // Getting the parametrization parameters } void process(aod::BCs const&) {} - using TrksRun2 = soa::Join; - o2::pid::tof::Beta responseBetaRun2; - void processRun2(TrksRun2 const& tracks) + o2::pid::tof::Beta responseBetaRun2; + void processRun2(Run2TrksWtofWevTime const& tracks) { if (!enableTableBeta && !enableTableMass) { return; @@ -1137,18 +1171,17 @@ 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", false); + PROCESS_SWITCH(tofPidBeta, processRun2, "Process Run3 data i.e. input is TrackIU. If false, taken from metadata automatically", true); - using Trks = soa::Join; - o2::pid::tof::Beta responseBeta; - void processRun3(Trks const& tracks) + o2::pid::tof::Beta responseBeta; + void processRun3(Run3TrksWtofWevTime const& tracks) { if (!enableTableBeta && !enableTableMass) { return; @@ -1163,14 +1196,14 @@ 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, processRun3, "Process Run3 data i.e. input is TrackIU. If false, taken from metadata automatically", false); + PROCESS_SWITCH(tofPidBeta, processRun3, "Process Run3 data i.e. input is TrackIU. If false, taken from metadata automatically", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From ce9b5aa92eff672876c71d1886ed0d8eba6bd68c Mon Sep 17 00:00:00 2001 From: Francesco Mazzaschi <43742195+fmazzasc@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:13:08 +0200 Subject: [PATCH 41/60] Add cluster size and TPCChi2 (#7589) Co-authored-by: Francesco Mazzaschi --- PWGLF/DataModel/LFHypernucleiTables.h | 16 +++++----- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 32 +++++++++++--------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/PWGLF/DataModel/LFHypernucleiTables.h b/PWGLF/DataModel/LFHypernucleiTables.h index ba81c59b502..46955373222 100644 --- a/PWGLF/DataModel/LFHypernucleiTables.h +++ b/PWGLF/DataModel/LFHypernucleiTables.h @@ -56,12 +56,14 @@ DECLARE_SOA_COLUMN(NTPCclusHe, nTPCclusHe, uint8_t); // Number of DECLARE_SOA_COLUMN(NTPCclusPi, nTPCclusPi, uint8_t); // Number of TPC clusters of the Pi daughter DECLARE_SOA_COLUMN(TPCsignalHe, tpcSignalHe, uint16_t); // TPC signal of the He daughter DECLARE_SOA_COLUMN(TPCsignalPi, tpcSignalPi, uint16_t); // TPC signal of the Pi daughter -DECLARE_SOA_COLUMN(Tracked, tracked, bool); // bool: true for tracked candidates +DECLARE_SOA_COLUMN(TPCChi2He, tpcChi2He, float); // TPC chi2 of the He daughter +DECLARE_SOA_COLUMN(TrackedClSize, trackedClSize, int); // int: zero for non-tracked candidates DECLARE_SOA_COLUMN(Flags, flags, uint8_t); // Flags for PID in tracking (bits [0, 3] for negative daughter, [4,7] for positive daughter) DECLARE_SOA_COLUMN(TPCmomHe, tpcMomHe, float); // TPC momentum of the He daughter DECLARE_SOA_COLUMN(TPCmomPi, tpcMomPi, float); // TPC momentum of the Pi daughter DECLARE_SOA_COLUMN(ITSclusterSizesHe, itsClusterSizesHe, uint32_t); // ITS cluster size of the He daughter DECLARE_SOA_COLUMN(ITSclusterSizesPi, itsClusterSizesPi, uint32_t); // ITS cluster size of the Pi daughter +DECLARE_SOA_COLUMN(ITSclusterSizesHyp, itsClusterSizesHyp, uint32_t); // ITS cluster size of the Pi daughter DECLARE_SOA_COLUMN(DcaHe, dcaHe, float); // DCA between He daughter and V0 DECLARE_SOA_COLUMN(DcaPi, dcaPi, float); // DCA between pi daughter and V0 DECLARE_SOA_COLUMN(GenPt, genPt, float); // Pt of the hypertriton @@ -88,9 +90,9 @@ DECLARE_SOA_TABLE(DataHypCands, "AOD", "HYPCANDS", hyperrec::XDecVtx, hyperrec::YDecVtx, hyperrec::ZDecVtx, hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi, hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi, - hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, + hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He, hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi, - hyperrec::Flags, hyperrec::Tracked); + hyperrec::Flags, hyperrec::TrackedClSize); DECLARE_SOA_TABLE(DataHypCandsFlow, "AOD", "HYPCANDSFLOW", o2::soa::Index<>, @@ -106,9 +108,9 @@ DECLARE_SOA_TABLE(DataHypCandsFlow, "AOD", "HYPCANDSFLOW", hyperrec::XDecVtx, hyperrec::YDecVtx, hyperrec::ZDecVtx, hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi, hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi, - hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, + hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He, hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi, - hyperrec::Flags, hyperrec::Tracked); + hyperrec::Flags, hyperrec::TrackedClSize); DECLARE_SOA_TABLE(MCHypCands, "AOD", "MCHYPCANDS", o2::soa::Index<>, @@ -121,9 +123,9 @@ DECLARE_SOA_TABLE(MCHypCands, "AOD", "MCHYPCANDS", hyperrec::XDecVtx, hyperrec::YDecVtx, hyperrec::ZDecVtx, hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi, hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi, - hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, + hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He, hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi, - hyperrec::Flags, hyperrec::Tracked, + hyperrec::Flags, hyperrec::TrackedClSize, hyperrec::GenPt, hyperrec::GenPhi, hyperrec::GenEta, diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index a085e6cae51..8951e0eba29 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -102,6 +102,7 @@ struct hyperCandidate { std::array gDecVtx; uint16_t tpcSignalHe3 = 0u; uint16_t tpcSignalPi = 0u; + float tpcChi2He3 = 0.f; uint8_t nTPCClustersHe3 = 0u; uint8_t nTPCClustersPi = 0u; uint32_t clusterSizeITSHe3 = 0u; @@ -186,7 +187,7 @@ struct hyperRecoTask { std::vector recoCollisionIds; std::vector isSurvEvSelCollision; std::vector goodCollision; - std::vector isTracked; + std::vector trackedClSize; Preslice perCollision = o2::aod::v0::collisionId; @@ -382,6 +383,7 @@ struct hyperRecoTask { hypCand.clusterSizeITSHe3 = heTrack.itsClusterSizes(); hypCand.nTPCClustersPi = piTrack.tpcNClsFound(); hypCand.tpcSignalPi = piTrack.tpcSignal(); + hypCand.tpcChi2He3 = heTrack.tpcChi2NCl(); hypCand.clusterSizeITSPi = piTrack.itsClusterSizes(); bool heliumPID = heTrack.pidForTracking() == o2::track::PID::Helium3 || heTrack.pidForTracking() == o2::track::PID::Alpha; hypCand.momHe3TPC = (heliumPID && cfgCompensatePIDinTracking) ? heTrack.tpcInnerParam() / 2 : heTrack.tpcInnerParam(); @@ -440,7 +442,7 @@ struct hyperRecoTask { hH3LMassBefSel->Fill(massH3L); hH4LMassBefSel->Fill(massH4L); - if (!isTracked.empty() && isTracked[hypCand.v0ID]) { + if (!trackedClSize.empty() && trackedClSize[hypCand.v0ID] > 0) { hH3LMassTracked->Fill(massH3L); hH4LMassTracked->Fill(massH4L); } @@ -618,10 +620,10 @@ struct hyperRecoTask { void processDataTracked(CollisionsFull const& collisions, aod::V0s const& V0s, aod::TrackedV0s const& tV0s, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCsWithTimestamps const& bcs) { - isTracked.clear(); - isTracked.resize(V0s.size(), false); + trackedClSize.clear(); + trackedClSize.resize(V0s.size(), 0); for (const auto& tV0 : tV0s) { - isTracked[tV0.v0Id()] = true; + trackedClSize[tV0.v0Id()] = tV0.itsClsSize(); } processData(collisions, V0s, tracks, ambiTracks, bcs); } @@ -646,8 +648,8 @@ struct hyperRecoTask { hypCand.decVtx[0], hypCand.decVtx[1], hypCand.decVtx[2], hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY, hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi, - hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, - hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, !isTracked.empty() && isTracked[hypCand.v0ID]); + hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3, + hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedClSize[hypCand.v0ID]); } } PROCESS_SWITCH(hyperRecoTask, processData, "Data analysis", true); @@ -675,8 +677,8 @@ struct hyperRecoTask { hypCand.decVtx[0], hypCand.decVtx[1], hypCand.decVtx[2], hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY, hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi, - hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, - hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, !isTracked.empty() && isTracked[hypCand.v0ID]); + hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3, + hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedClSize[hypCand.v0ID]); } } PROCESS_SWITCH(hyperRecoTask, processDataWithFlow, "Data analysis with flow", false); @@ -708,8 +710,8 @@ struct hyperRecoTask { hypCand.decVtx[0], hypCand.decVtx[1], hypCand.decVtx[2], hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY, hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi, - hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, - hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, !isTracked.empty() && isTracked[hypCand.v0ID], + hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3, + hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedClSize[hypCand.v0ID], chargeFactor * hypCand.genPt(), hypCand.genPhi(), hypCand.genEta(), hypCand.genPtHe3(), hypCand.gDecVtx[0], hypCand.gDecVtx[1], hypCand.gDecVtx[2], hypCand.isReco, hypCand.isSignal, hypCand.isRecoMCCollision, hypCand.isSurvEvSelection); @@ -782,7 +784,7 @@ struct hyperRecoTask { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, false, + -1, -1, -1, false, -1, chargeFactor * hypCand.genPt(), hypCand.genPhi(), hypCand.genEta(), hypCand.genPtHe3(), hypCand.gDecVtx[0], hypCand.gDecVtx[1], hypCand.gDecVtx[2], hypCand.isReco, hypCand.isSignal, hypCand.isRecoMCCollision, hypCand.isSurvEvSelection); @@ -792,10 +794,10 @@ struct hyperRecoTask { void processMCTracked(CollisionsFullMC const& collisions, aod::McCollisions const& mcCollisions, aod::V0s const& V0s, aod::TrackedV0s const& tV0s, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCsWithTimestamps const& bcs, aod::McTrackLabels const& trackLabelsMC, aod::McParticles const& particlesMC) { - isTracked.clear(); - isTracked.resize(V0s.size(), false); + trackedClSize.clear(); + trackedClSize.resize(V0s.size(), 0); for (const auto& tV0 : tV0s) { - isTracked[tV0.v0Id()] = true; + trackedClSize[tV0.v0Id()] = tV0.itsClsSize(); } processMC(collisions, mcCollisions, V0s, tracks, ambiTracks, bcs, trackLabelsMC, particlesMC); } From f56a28973a322173c36f3d9bdef199d194a02c98 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:23:05 +0200 Subject: [PATCH 42/60] PWGCF / FemtoUniverse : Bug fix in centrality bin selection (#7591) --- ...mtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index a2aeb512642..8758c68d4a8 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -132,8 +132,9 @@ 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; + using FilteredFDCollision = soa::Filtered::iterator; // Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable /// Particle part @@ -533,7 +534,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// process function for 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, + void processSameEvent(FilteredFDCollision& col, FilteredFemtoFullParticles& parts) { fillCollision(col); @@ -625,7 +626,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(soa::Filtered& cols, + void processMixedEvent(FilteredFDCollisions& cols, FilteredFemtoFullParticles& parts) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ConfNEventsMix, -1, cols, cols)) { From f64c2f7089f1a3e2a0f6341e990af6e03bc1cbde Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 6 Sep 2024 16:34:57 +0200 Subject: [PATCH 43/60] Common/Mult: add pvZ from T0 for centrality (#7592) --- Common/DataModel/Multiplicity.h | 30 +++++++++++-------- .../TableProducer/multiplicityExtraTable.cxx | 9 ++++-- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index d34028467e2..7116ce66062 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -178,12 +178,12 @@ DECLARE_SOA_COLUMN(MultBCFV0A, multBCFV0A, float); //! DECLARE_SOA_COLUMN(MultBCFDDA, multBCFDDA, float); //! DECLARE_SOA_COLUMN(MultBCFDDC, multBCFDDC, float); //! -DECLARE_SOA_COLUMN(MultBCFZNA, multBCFZNA, float); //! -DECLARE_SOA_COLUMN(MultBCFZNC, multBCFZNC, float); //! -DECLARE_SOA_COLUMN(MultBCFZEM1, multBCFZEM1, float); //! -DECLARE_SOA_COLUMN(MultBCFZEM2, multBCFZEM2, float); //! -DECLARE_SOA_COLUMN(MultBCFZPA, multBCFZPA, float); //! -DECLARE_SOA_COLUMN(MultBCFZPC, multBCFZPC, 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); //! DECLARE_SOA_COLUMN(MultBCTVX, multBCTVX, bool); //! DECLARE_SOA_COLUMN(MultBCFV0OrA, multBCFV0OrA, bool); //! @@ -192,19 +192,25 @@ 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_TABLE(MultsBC, "AOD", "MULTBC", //! multBC::MultBCFT0A, multBC::MultBCFT0C, + multBC::MultBCFT0PosZ, + multBC::MultBCFT0PosZValid, multBC::MultBCFV0A, multBC::MultBCFDDA, multBC::MultBCFDDC, - multBC::MultBCFZNA, - multBC::MultBCFZNC, - multBC::MultBCFZEM1, - multBC::MultBCFZEM2, - multBC::MultBCFZPA, - multBC::MultBCFZPC, + multBC::MultBCZNA, + multBC::MultBCZNC, + multBC::MultBCZEM1, + multBC::MultBCZEM2, + multBC::MultBCZPA, + multBC::MultBCZPC, multBC::MultBCTVX, multBC::MultBCFV0OrA, multBC::MultBCV0triggerBits, diff --git a/Common/TableProducer/multiplicityExtraTable.cxx b/Common/TableProducer/multiplicityExtraTable.cxx index a04cf79246d..c3f1aa9cee3 100644 --- a/Common/TableProducer/multiplicityExtraTable.cxx +++ b/Common/TableProducer/multiplicityExtraTable.cxx @@ -124,6 +124,9 @@ struct MultiplicityExtraTable { float multZPA = -1.f; float multZPC = -1.f; + float posZFT0 = -1e+3; + bool posZFT0valid = false; + uint8_t multFT0TriggerBits = 0; uint8_t multFV0TriggerBits = 0; uint8_t multFDDTriggerBits = 0; @@ -146,7 +149,7 @@ struct MultiplicityExtraTable { bool collidingBC = CollidingBunch.test(localBC); if (bc.has_ft0()) { - auto ft0 = bc.ft0(); + const auto& ft0 = bc.ft0(); std::bitset<8> triggers = ft0.triggerMask(); Tvx = triggers[o2::fit::Triggers::bitVertex]; multFT0TriggerBits = static_cast(triggers.to_ulong()); @@ -158,6 +161,8 @@ struct MultiplicityExtraTable { for (auto amplitude : ft0.amplitudeC()) { multFT0C += amplitude; } + posZFT0 = ft0.posZ(); + posZFT0valid = ft0.isValidTime(); } else { multFT0A = -999.0f; multFT0C = -999.0f; @@ -208,7 +213,7 @@ struct MultiplicityExtraTable { } bc2mult(bc2multArray[bc.globalIndex()]); - multBC(multFT0A, multFT0C, multFV0A, multFDDA, multFDDC, multZNA, multZNC, multZEM1, multZEM2, multZPA, multZPC, Tvx, isFV0OrA, multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC); + multBC(multFT0A, multFT0C, posZFT0, posZFT0valid, multFV0A, multFDDA, multFDDC, multZNA, multZNC, multZEM1, multZEM2, multZPA, multZPC, Tvx, isFV0OrA, multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC); } } From 080ac0a31733582cadb926bea27d119d91f4e28c Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Fri, 6 Sep 2024 18:23:42 +0200 Subject: [PATCH 44/60] Adding class to move TPC standalone tracks + PCM usage (#7491) * COMMON: Add class to move TPC standalone to different collisions Signed-off-by: Felix Schlepper * PCM: Use moved TPC standalone tracks Signed-off-by: Felix Schlepper --------- Signed-off-by: Felix Schlepper Co-authored-by: Daiki Sekihata --- Common/Core/CMakeLists.txt | 4 + Common/Core/TPCVDriftManager.h | 165 ++++++++++++++++++ .../PhotonMeson/TableProducer/CMakeLists.txt | 2 +- .../TableProducer/photonconversionbuilder.cxx | 80 ++++++--- PWGEM/PhotonMeson/Utils/PCMUtilities.h | 27 ++- 5 files changed, 238 insertions(+), 40 deletions(-) create mode 100644 Common/Core/TPCVDriftManager.h diff --git a/Common/Core/CMakeLists.txt b/Common/Core/CMakeLists.txt index 9fcb1234de5..babf1a6ccdc 100644 --- a/Common/Core/CMakeLists.txt +++ b/Common/Core/CMakeLists.txt @@ -34,3 +34,7 @@ o2physics_target_root_dictionary(AnalysisCore PID/TPCPIDResponse.h CollisionTypeHelper.h LINKDEF AnalysisCoreLinkDef.h) + +o2physics_add_header_only_library(TPCDriftManager + HEADERS TPCVDriftManager.h + INTERFACE_LINK_LIBRARIES O2::DataFormatsTPC) diff --git a/Common/Core/TPCVDriftManager.h b/Common/Core/TPCVDriftManager.h new file mode 100644 index 00000000000..5a3e33bdb2b --- /dev/null +++ b/Common/Core/TPCVDriftManager.h @@ -0,0 +1,165 @@ +// 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_CORE_TPCVDRIFTMANAGER_H_ +#define COMMON_CORE_TPCVDRIFTMANAGER_H_ + +#include + +#include "CCDB/BasicCCDBManager.h" +#include "Framework/Logger.h" +#include "Framework/DataTypes.h" +#include "DataFormatsTPC/VDriftCorrFact.h" +#include "CommonConstants/LHCConstants.h" +#include "DataFormatsParameters/GRPLHCIFData.h" +#include "DataFormatsParameters/GRPECSObject.h" +#include "ReconstructionDataFormats/Track.h" + +namespace o2::aod::common +{ + +// Thin wrapper for vdrift ccdb queries should partially mirror VDriftHelper class. +// Allows to move TPC standalone tracks under the assumption of a different +// collision than the track is associated to. +class TPCVDriftManager +{ + public: + void init(o2::ccdb::BasicCCDBManager* ccdb) noexcept + { + mCCDB = ccdb; + } + + void update(uint64_t timestamp) noexcept + { + // Check validity of already present obj, otherwise update + if (mVD != nullptr && (timestamp > mVD->firstTime || timestamp < mVD->lastTime)) { + return; + } + + // Update Obj + mVD = mCCDB->getForTimeStamp("TPC/Calib/VDriftTgl", timestamp); + if (mVD == nullptr) { + LOGP(error, "Got nullptr from ccdb for VDriftCorrFact for {}", timestamp); + return; + } + + // TODO account for laser calib + + // Update factors + mTPCVDriftNS = mVD->refVDrift * mVD->corrFact * 1e-3; + + LOGP(info, "Updated VDrift for timestamp {} with vdrift={:.7f} (cm/ns)", mVD->creationTime, mTPCVDriftNS); + } + + template + [[nodiscard]] bool moveTPCTrack(const Collision& col, const TrackExtra& trackExtra, Track& track) noexcept + { + ++mCalls; + // track is fine, or cannot be moved has information is not available + if (!(trackExtra.flags() & o2::aod::track::TrackFlags::TrackTimeAsym)) { + ++mNoFlag; + return true; + } + + // Check if there is a good object available otherwise pretend everything is fine + if (mVD == nullptr) { + LOGP(warn, "No VDrift object available, pretending track to be correct"); + ++mNull; + return true; + } + + // FS TODO + // add geometrical check for constrained tracks, e.g., tracks which cross the central pad. + + // TPC time is given relative to the closest BC in ns + float tTB, tTBErr; + if (col.collisionTimeRes() < 0.f) { // use track data + ++mColResNeg; + tTB = trackExtra.trackTime(); + o2::aod::track::extensions::TPCTimeErrEncoding enc; + enc.encoding.timeErr = trackExtra.trackTimeRes(); + tTBErr = 0.5f * (enc.getDeltaTFwd() + enc.getDeltaTBwd()); + } else { + ++mColResPos; + // The TPC track can be associated to a different BC than the one the collision under assumption is; + // we need to calculate the difference and subtract this from the trackTime() + const auto& trackBC = trackExtra.template collision_as().template foundBC_as().globalBC(); + const auto& colBC = col.template foundBC_as().globalBC(); + float sign{1.f}; + uint64_t diffBC{0}; + if (colBC < trackBC) { + sign = 1.f; + diffBC = (trackBC - colBC); + } else { + diffBC = (colBC - trackBC); + } + float diffBCNS = sign * diffBC * o2::constants::lhc::LHCBunchSpacingNS; + tTB = col.collisionTime() + diffBCNS; + tTBErr = col.collisionTimeRes(); + } + float dTime = tTB - trackExtra.trackTime(); + float dDrift = dTime * mTPCVDriftNS; + float dDriftErr = tTBErr * mTPCVDriftNS; + if (dDriftErr < 0.f || dDrift > 250.f) { // we cannot move a track outside the drift volume + if (mOutside < mWarningLimit) { + LOGP(warn, "Skipping correction outside of tpc volume with dDrift={} +- {}", dDrift, dDriftErr); + const auto& trackBC = trackExtra.template collision_as().template foundBC_as().globalBC(); + const auto& colBC = col.template foundBC_as().globalBC(); + int diffBC = colBC - trackBC; + LOGP(info, "ct={}; ctr={}; tTB={}; t0={}; dTime={}; dDrift={}; tgl={}: colBC={} trackBC={} diffBC={}", col.collisionTime(), col.collisionTimeRes(), tTB, trackExtra.trackTime(), dTime, dDrift, track.getTgl(), colBC, trackBC, diffBC); + if (mOutside == mWarningLimit - 1) { + LOGP(warn, "Silencing further warnings!"); + } + } + ++mOutside; + return false; + } + + // impose new Z coordinate + track.setZ(track.getZ() + ((track.getTgl() < 0.) ? -dDrift : dDrift)); + if constexpr (std::is_base_of_v) { + track.setCov(track.getSigmaZ2() + dDriftErr * dDriftErr, o2::track::kSigZ2); + } + + ++mMovedTrks; + + return true; + } + + void print() noexcept + { + LOGP(info, "TPC corrections called: {}; Moved Tracks: {}; Constrained Tracks={}; No Flag: {}; NULL: {}; Outside: {}; ColResPos {}; ColResNeg {};", mCalls, mMovedTrks, mConstrained, mNoFlag, mNull, mOutside, mColResPos, mColResNeg); + } + + private: + // Factors + float mTPCVDriftNS{0.f}; // drift velocity in cm/ns + + // CCDB + const o2::tpc::VDriftCorrFact* mVD{}; // reference to drift correction + o2::ccdb::BasicCCDBManager* mCCDB{}; // reference to initialized ccdb manager + + static constexpr unsigned int mWarningLimit{10}; + + // Counters + unsigned int mCalls{0}; // total number of calls + unsigned int mMovedTrks{0}; // number of moved tracks + unsigned int mNull{0}; // number of tracks where no drift object was available + unsigned int mColResNeg{0}; // number of collisions with negative resolution + unsigned int mColResPos{0}; // number of collisions with positive resolution + unsigned int mNoFlag{0}; // number of tracks without flag set + unsigned int mOutside{0}; // number of tracks moved but outside of sensible volume + unsigned int mConstrained{0}; // number of constrained tracks +}; + +} // namespace o2::aod::common + +#endif // COMMON_CORE_TPCVDRIFTMANAGER_H_ diff --git a/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt b/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt index a468376a761..7d58cb0cb7c 100644 --- a/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt +++ b/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt @@ -21,7 +21,7 @@ o2physics_add_dpl_workflow(skimmer-gamma-conversion-truthonlymc o2physics_add_dpl_workflow(photon-conversion-builder SOURCES photonconversionbuilder.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore KFParticle::KFParticle + PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore KFParticle::KFParticle O2Physics::TPCDriftManager COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(create-pcm diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 81346b201cf..4a625357f47 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -40,6 +40,7 @@ #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" #include "Common/Core/TableHelper.h" +#include "Common/Core/TPCVDriftManager.h" #include "Tools/KFparticle/KFUtilities.h" @@ -84,6 +85,8 @@ struct PhotonConversionBuilder { // single track cuts Configurable min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"}; Configurable mincrossedrows{"mincrossedrows", 40, "min crossed rows"}; + Configurable moveTPCTracks{"moveTPCTracks", true, "Move TPC-only tracks under the collision assumption"}; + Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max chi2/NclsTPC"}; // default 4.0 + 1.0 Configurable maxchi2its{"maxchi2its", 6.0, "max chi2/NclsITS"}; // default 5.0 + 1.0 Configurable maxpt_itsonly{"maxpt_itsonly", 0.15, "max pT for ITSonly tracks at SV"}; @@ -128,6 +131,7 @@ struct PhotonConversionBuilder { Service ccdb; o2::base::MatLayerCylSet* lut = nullptr; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; + o2::aod::common::TPCVDriftManager mVDriftMgr; HistogramRegistry registry{ "registry", @@ -188,10 +192,12 @@ struct PhotonConversionBuilder { lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(lutPath)); } - if (useMatCorrType == 1) + if (useMatCorrType == 1) { matCorr = o2::base::Propagator::MatCorrType::USEMatCorrTGeo; - if (useMatCorrType == 2) + } + if (useMatCorrType == 2) { matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + } } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -213,18 +219,19 @@ struct PhotonConversionBuilder { } auto run3grp_timestamp = bc.timestamp(); - o2::parameters::GRPObject* grpo = 0x0; - o2::parameters::GRPMagField* grpmag = 0x0; - if (!skipGRPOquery) + o2::parameters::GRPObject* grpo = nullptr; + o2::parameters::GRPMagField* grpmag = nullptr; + if (!skipGRPOquery) { grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); - if (grpo) { + } + if (grpo != nullptr) { 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"; } else { grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); - if (!grpmag) { + if (grpmag == nullptr) { 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); @@ -239,8 +246,17 @@ struct PhotonConversionBuilder { o2::base::Propagator::Instance()->setMatLUT(lut); } /// Set magnetic field for KF vertexing - float magneticField = o2::base::Propagator::Instance()->getNominalBz(); + const float magneticField = o2::base::Propagator::Instance()->getNominalBz(); KFParticle::SetField(magneticField); + + mVDriftMgr.init(&ccdb->instance()); + } + + void updateCCDB(aod::BCsWithTimestamps::iterator const& bc) + { + auto timestamp = bc.timestamp(); + + mVDriftMgr.update(timestamp); } std::pair> its_ib_Requirement = {0, {0, 1, 2}}; // no hit on 3 ITS ib layers. @@ -356,13 +372,13 @@ struct PhotonConversionBuilder { track.x(), track.y(), track.z(), track.tgl()); } - template + template void fillV0Table(TV0 const& v0, const bool filltable) { // Get tracks - auto pos = v0.template posTrack_as(); - auto ele = v0.template negTrack_as(); - auto collision = v0.template collision_as(); // collision where this v0 belongs. + const auto& pos = v0.template posTrack_as(); + const auto& ele = v0.template negTrack_as(); + const auto& collision = v0.template collision_as(); // collision where this v0 belongs to. if (pos.sign() * ele.sign() > 0) { // reject same sign pair return; @@ -379,6 +395,7 @@ struct PhotonConversionBuilder { if (isITSonlyTrack(pos) && !ele.hasITS()) { return; } + if (isITSonlyTrack(ele) && !pos.hasITS()) { return; } @@ -386,20 +403,31 @@ struct PhotonConversionBuilder { if (!checkV0leg(pos) || !checkV0leg(ele)) { return; } + // LOGF(info, "v0.collisionId() = %d , v0.posTrackId() = %d , v0.negTrackId() = %d", v0.collisionId(), v0.posTrackId(), v0.negTrackId()); // Calculate DCA with respect to the collision associated to the v0, not individual tracks gpu::gpustd::array dcaInfo; auto pTrack = getTrackParCov(pos); - pTrack.setPID(o2::track::PID::Electron); - o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, pTrack, 2.f, matCorr, &dcaInfo); + if (moveTPCTracks && isTPConlyTrack(pos) && !mVDriftMgr.moveTPCTrack(collision, pos, pTrack)) { + LOGP(error, "failed correction for positive tpc track"); + return; + } + auto pTrackC = pTrack; + pTrackC.setPID(o2::track::PID::Electron); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, pTrackC, 2.f, matCorr, &dcaInfo); auto posdcaXY = dcaInfo[0]; auto posdcaZ = dcaInfo[1]; auto nTrack = getTrackParCov(ele); - nTrack.setPID(o2::track::PID::Electron); - o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, nTrack, 2.f, matCorr, &dcaInfo); + if (moveTPCTracks && isTPConlyTrack(ele) && !mVDriftMgr.moveTPCTrack(collision, ele, nTrack)) { + LOGP(error, "failed correction for negative tpc track"); + return; + } + auto nTrackC = nTrack; + nTrackC.setPID(o2::track::PID::Electron); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, nTrackC, 2.f, matCorr, &dcaInfo); auto eledcaXY = dcaInfo[0]; auto eledcaZ = dcaInfo[1]; @@ -408,7 +436,7 @@ struct PhotonConversionBuilder { } float xyz[3] = {0.f, 0.f, 0.f}; - Vtx_recalculation(o2::base::Propagator::Instance(), pos, ele, xyz, matCorr); + Vtx_recalculationParCov(o2::base::Propagator::Instance(), pTrack, nTrack, xyz, matCorr); float rxy_tmp = RecoDecay::sqrtSumOfSquares(xyz[0], xyz[1]); if (rxy_tmp > maxX + margin_r_tpc) { return; @@ -417,8 +445,8 @@ struct PhotonConversionBuilder { return; // RZ line cut } - KFPTrack kfp_track_pos = createKFPTrackFromTrack(pos); - KFPTrack kfp_track_ele = createKFPTrackFromTrack(ele); + KFPTrack kfp_track_pos = createKFPTrackFromTrackParCov(pTrack, pos.sign(), pos.tpcNClsFound(), pos.tpcChi2NCl()); + KFPTrack kfp_track_ele = createKFPTrackFromTrackParCov(nTrack, ele.sign(), ele.tpcNClsFound(), ele.tpcChi2NCl()); KFParticle kfp_pos(kfp_track_pos, -11); KFParticle kfp_ele(kfp_track_ele, 11); const KFParticle* GammaDaughters[2] = {&kfp_pos, &kfp_ele}; @@ -647,7 +675,7 @@ struct PhotonConversionBuilder { template void build(TCollisions const& collisions, TV0s const& v0s, TTracks const&, TBCs const&) { - for (auto& collision : collisions) { + for (const auto& collision : collisions) { if constexpr (isMC) { if (!collision.has_mcCollision()) { continue; @@ -668,7 +696,7 @@ struct PhotonConversionBuilder { nv0_map[collision.globalIndex()] = 0; - auto bc = collision.template foundBC_as(); + const auto& bc = collision.template bc_as(); initCCDB(bc); registry.fill(HIST("hCollisionCounter"), 1); @@ -676,11 +704,13 @@ struct PhotonConversionBuilder { continue; } - auto v0s_per_coll = v0s.sliceBy(perCollision, collision.globalIndex()); + updateCCDB(bc); // delay update until is needed + + const auto& v0s_per_coll = v0s.sliceBy(perCollision, collision.globalIndex()); // LOGF(info, "n v0 = %d", v0s_per_coll.size()); - for (auto& v0 : v0s_per_coll) { + for (const auto& v0 : v0s_per_coll) { // LOGF(info, "collision.globalIndex() = %d, v0.globalIndex() = %d, v0.posTrackId() = %d, v0.negTrackId() = %d", collision.globalIndex(), v0.globalIndex(), v0.posTrackId() , v0.negTrackId()); - fillV0Table(v0, false); + fillV0Table(v0, false); } // end of v0 loop } // end of collision loop @@ -755,7 +785,7 @@ struct PhotonConversionBuilder { // LOGF(info, "collision_tmp.globalIndex() = %d, collision_tmp.neeuls() = %d, nv0_map = %d", collision_tmp.globalIndex(), collision_tmp.neeuls(), nv0_map[collision_tmp.globalIndex()]); } - fillV0Table(v0, true); + fillV0Table(v0, true); } // end of fullv0Id loop for (auto& collision : collisions) { diff --git a/PWGEM/PhotonMeson/Utils/PCMUtilities.h b/PWGEM/PhotonMeson/Utils/PCMUtilities.h index 38492dae9e6..9530fa03c4f 100644 --- a/PWGEM/PhotonMeson/Utils/PCMUtilities.h +++ b/PWGEM/PhotonMeson/Utils/PCMUtilities.h @@ -47,18 +47,11 @@ inline float v0_qt(float pxpos, float pypos, float pzpos, float pxneg, float pyn return std::sqrt(RecoDecay::p2(pxneg, pyneg, pzneg) - dp * dp / momTot); // qt of v0 } //_______________________________________________________________________ -template -inline void Vtx_recalculation(o2::base::Propagator* prop, T1 lTrackPos, T2 lTrackNeg, float xyz[3], o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE) +template +inline void Vtx_recalculationParCov(o2::base::Propagator* prop, const o2::track::TrackParametrizationWithError& trackPosInformation, const o2::track::TrackParametrizationWithError& trackNegInformation, float xyz[3], o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE) { float bz = prop->getNominalBz(); - //******************************************************* - - o2::track::TrackParametrizationWithError trackPosInformation = getTrackParCov(lTrackPos); // first get an object that stores Track information (positive) - o2::track::TrackParametrizationWithError trackNegInformation = getTrackParCov(lTrackNeg); // first get an object that stores Track information (negative) - trackPosInformation.setPID(o2::track::PID::Electron); - trackNegInformation.setPID(o2::track::PID::Electron); - o2::track::TrackAuxPar helixPos(trackPosInformation, bz); // This object is a descendant of a CircleXY and stores cirlce information with respect to the magnetic field. This object uses functions and information of the o2::track::TrackParametrizationWithError object (positive) o2::track::TrackAuxPar helixNeg(trackNegInformation, bz); // This object is a descendant of a CircleXY and stores cirlce information with respect to the magnetic field. This object uses functions and information of the o2::track::TrackParametrizationWithError object (negative) @@ -66,10 +59,8 @@ inline void Vtx_recalculation(o2::base::Propagator* prop, T1 lTrackPos, T2 lTrac xyz[1] = (helixPos.yC * helixNeg.rC + helixNeg.yC * helixPos.rC) / (helixPos.rC + helixNeg.rC); // If this calculation doesn't work check if the rotateZ function, because the "documentation" says I get global coordinates but maybe i don't. // I am unsure about the Z calculation but this is how it is done in AliPhysics as far as I understand - o2::track::TrackParametrizationWithError trackPosInformationCopy = o2::track::TrackParametrizationWithError(trackPosInformation); - o2::track::TrackParametrizationWithError trackNegInformationCopy = o2::track::TrackParametrizationWithError(trackNegInformation); - trackPosInformationCopy.setPID(o2::track::PID::Electron); - trackNegInformationCopy.setPID(o2::track::PID::Electron); + auto trackPosInformationCopy = trackPosInformation; + auto trackNegInformationCopy = trackNegInformation; // I think this calculation gets the closest point on the track to the conversion point // This alpha is a different alpha than the usual alpha and I think it is the angle between X axis and conversion point @@ -104,5 +95,13 @@ inline void Vtx_recalculation(o2::base::Propagator* prop, T1 lTrackPos, T2 lTrac xyz[2] = (trackPosInformationCopy.getZ() * helixNeg.rC + trackNegInformationCopy.getZ() * helixPos.rC) / (helixPos.rC + helixNeg.rC); } //_______________________________________________________________________ -//_______________________________________________________________________ +template +inline void Vtx_recalculation(o2::base::Propagator* prop, T1 lTrackPos, T2 lTrackNeg, float xyz[3], o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE) +{ + // o2::track::TrackParametrizationWithError = TrackParCov, I use the full version to have control over the data type + o2::track::TrackParametrizationWithError trackPosInformation = getTrackParCov(lTrackPos); // first get an object that stores Track information (positive) + o2::track::TrackParametrizationWithError trackNegInformation = getTrackParCov(lTrackNeg); // first get an object that stores Track information (negative) + + Vtx_recalculationParCov(prop, trackPosInformation, trackNegInformation, xyz, matCorr); +} #endif // PWGEM_PHOTONMESON_UTILS_PCMUTILITIES_H_ From d584edc8a3fc18c372bba1a38eba9bfdd223b4f3 Mon Sep 17 00:00:00 2001 From: motomioya <95481703+motomioya@users.noreply.github.com> Date: Sat, 7 Sep 2024 01:51:09 +0900 Subject: [PATCH 45/60] Fix bug in collision loop handling (#7593) --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 2ff783951d6..f7df4a672bc 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -525,7 +525,7 @@ struct TableMaker { } } else { if (!fEventCut->IsSelected(VarManager::fgValues)) { - return; + continue; } } From d2e6af05d5375b39dd8da2777ee3f1af80bde615 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 6 Sep 2024 21:17:11 +0200 Subject: [PATCH 46/60] PWGLF/hStrCorr: add extra debug/QA histos (#7594) * PWGLF/hStrCorr: add extra debug/QA histos @lhusova @kcui1 @ChiaraDeMartin95 * Update hStrangeCorrelation.cxx add missing eta cut * Please consider the following formatting changes (#7595) --------- Co-authored-by: ALICE Builder --- .../Tasks/Strangeness/hStrangeCorrelation.cxx | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 5070e2b03f9..e1773ce7e24 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -707,6 +707,11 @@ struct correlateStrangeness { } // Some QA plots + histos.add("hGeneratedQAPtTrigger", "hGeneratedQAPtTrigger", kTH2F, {axisPtQA, {5, -0.5f, 4.5f}}); + histos.add("hGeneratedQAPtAssociatedK0", "hGeneratedQAPtAssociatedK0", kTH2F, {axisPtQA, {5, -0.5f, 4.5f}}); + histos.add("hClosureQAPtTrigger", "hClosureQAPtTrigger", kTH2F, {axisPtQA, {5, -0.5f, 4.5f}}); + histos.add("hClosureQAPtAssociatedK0", "hClosureQAPtAssociatedK0", kTH2F, {axisPtQA, {5, -0.5f, 4.5f}}); + histos.add("hTrackEtaVsPtVsPhi", "hTrackEtaVsPtVsPhi", kTH3F, {axisPtQA, axisEta, axisPhi}); histos.add("hK0ShortEtaVsPtVsPhi", "hK0ShortEtaVsPtVsPhi", kTH3F, {axisPtQA, axisEta, axisPhi}); histos.add("hK0ShortEtaVsPtVsPhiBg", "hK0ShortEtaVsPtVsPhiBg", kTH3F, {axisPtQA, axisEta, axisPhi}); @@ -1174,6 +1179,25 @@ struct correlateStrangeness { { histos.fill(HIST("hClosureTestEventCounter"), 2.5f); + for (auto const& mcParticle : mcParticles) { + Double_t geta = mcParticle.eta(); + if (std::abs(geta) > 0.8f) { + continue; + } + Double_t gpt = mcParticle.pt(); + if (abs(mcParticle.pdgCode()) == 211 || abs(mcParticle.pdgCode()) == 321 || abs(mcParticle.pdgCode()) == 2212 || abs(mcParticle.pdgCode()) == 11 || abs(mcParticle.pdgCode()) == 13) { + if (!doTriggPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + histos.fill(HIST("hGeneratedQAPtTrigger"), gpt, 0.0f); // step 1: before all selections + } + } + + if (!doAssocPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + if (abs(mcParticle.pdgCode()) == 310 && doCorrelationK0Short) { + histos.fill(HIST("hGeneratedQAPtAssociatedK0"), gpt, 0.0f); // step 1: before all selections + } + } + } + for (auto const& mcParticle : mcParticles) { if (!mcParticle.isPhysicalPrimary()) continue; @@ -1250,6 +1274,25 @@ struct correlateStrangeness { histos.fill(HIST("hClosureTestEventCounter"), 3.5f); + for (auto const& mcParticle : mcParticles) { + Double_t geta = mcParticle.eta(); + if (std::abs(geta) > 0.8f) { + continue; + } + Double_t gpt = mcParticle.pt(); + if (abs(mcParticle.pdgCode()) == 211 || abs(mcParticle.pdgCode()) == 321 || abs(mcParticle.pdgCode()) == 2212 || abs(mcParticle.pdgCode()) == 11 || abs(mcParticle.pdgCode()) == 13) { + if (!doTriggPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + histos.fill(HIST("hGeneratedQAPtTrigger"), gpt, 1.0f); // step 2: after event selection + } + } + + if (!doAssocPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + if (abs(mcParticle.pdgCode()) == 310 && doCorrelationK0Short) { + histos.fill(HIST("hGeneratedQAPtAssociatedK0"), gpt, 1.0f); // step 2: before all selections + } + } + } + for (auto const& mcParticle : mcParticles) { if (!mcParticle.isPhysicalPrimary()) { continue; @@ -1309,6 +1352,25 @@ struct correlateStrangeness { std::vector omegaMinusIndices; std::vector omegaPlusIndices; + for (auto const& mcParticle : mcParticles) { + Double_t geta = mcParticle.eta(); + if (std::abs(geta) > 0.8f) { + continue; + } + Double_t gpt = mcParticle.pt(); + if (abs(mcParticle.pdgCode()) == 211 || abs(mcParticle.pdgCode()) == 321 || abs(mcParticle.pdgCode()) == 2212 || abs(mcParticle.pdgCode()) == 11 || abs(mcParticle.pdgCode()) == 13) { + if (!doTriggPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + histos.fill(HIST("hClosureQAPtTrigger"), gpt, 0.0f); // step 1: no event selection whatsoever + } + } + + if (!doAssocPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + if (abs(mcParticle.pdgCode()) == 310 && doCorrelationK0Short) { + histos.fill(HIST("hClosureQAPtAssociatedK0"), gpt, 0.0f); // step 1: no event selection whatsoever + } + } + } + histos.fill(HIST("hClosureTestEventCounter"), 0.5f); int bestCollisionFT0Mpercentile = -1; @@ -1339,6 +1401,25 @@ struct correlateStrangeness { histos.fill(HIST("hClosureTestEventCounter"), 1.5f); + for (auto const& mcParticle : mcParticles) { + Double_t geta = mcParticle.eta(); + if (std::abs(geta) > 0.8f) { + continue; + } + Double_t gpt = mcParticle.pt(); + if (abs(mcParticle.pdgCode()) == 211 || abs(mcParticle.pdgCode()) == 321 || abs(mcParticle.pdgCode()) == 2212 || abs(mcParticle.pdgCode()) == 11 || abs(mcParticle.pdgCode()) == 13) { + if (!doTriggPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + histos.fill(HIST("hClosureQAPtTrigger"), gpt, 1.0f); // step 2: after event selection + } + } + + if (!doAssocPhysicalPrimary || mcParticle.isPhysicalPrimary()) { + if (abs(mcParticle.pdgCode()) == 310 && doCorrelationK0Short) { + histos.fill(HIST("hClosureQAPtAssociatedK0"), gpt, 1.0f); // step 2: after event selection + } + } + } + int iteratorNum = -1; for (auto const& mcParticle : mcParticles) { iteratorNum = iteratorNum + 1; From 907277eedf1f277d96afaab95c0665f46d2a8f14 Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Sat, 7 Sep 2024 04:34:54 +0530 Subject: [PATCH 47/60] PWGCF: Update lambdaR2Correlation.cxx (#7577) * PWGCF: Update lambdaR2Correlation.cxx * PWGCF: Update lambdaR2Correlation.cxx --- .../Tasks/lambdaR2Correlation.cxx | 143 ++++++++++++------ 1 file changed, 95 insertions(+), 48 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index 2d4bd15a61d..b530c3d8fa8 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -131,10 +131,10 @@ struct lambdaCorrTableProducer { // Collisions Configurable cfg_z_vtx{"cfg_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_sel8_sel{"cfg_sel8_sel", true, "Sel8 (T0A + T0C) Selection"}; 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"}; @@ -146,6 +146,7 @@ struct lambdaCorrTableProducer { Configurable cfg_min_crossed_rows{"cfg_min_crossed_rows", 70, "min crossed rows"}; Configurable cfg_tpc_nsigma{"cfg_tpc_nsigma", 3.0, "TPC NSigma Selection Cut"}; Configurable cfg_tof_nsigma{"cfg_tof_nsigma", 3.0, "TOF NSigma Selection Cut"}; + Configurable cfg_tpc_only{"cfg_tpc_only", true, "TPC Only Selection"}; // V0s Configurable cfg_min_dca_V0_daughters{"cfg_min_dca_V0_daughters", 1.0, "min DCA between V0 daughters"}; @@ -161,8 +162,8 @@ struct lambdaCorrTableProducer { Configurable cfg_kshort_rej{"cfg_kshort_rej", 0.005, "Reject K0Short Candidates"}; // V0s kinmatic acceptance - Configurable cfg_v0_pt_min{"cfg_v0_pt_min", 0.5, "Minimum V0 pT"}; - Configurable cfg_v0_pt_max{"cfg_v0_pt_max", 2.5, "Minimum V0 pT"}; + 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 @@ -171,6 +172,7 @@ struct lambdaCorrTableProducer { // V0s MC Configurable cfg_is_primary_lambda{"cfg_is_primary_lambda", true, "Primary Lambda"}; Configurable cfg_casc_lambda{"cfg_casc_lambda", false, "Lambda from Cascade"}; + Configurable cfg_has_mc_flag{"cfg_has_mc_flag", false, "Has Mc Tag"}; // lambda mass windows Configurable> cfg_lambda_mass{"cfg_lambda_mass", {1.11, 1.12}, "Minimum Central Window"}; @@ -188,6 +190,7 @@ struct lambdaCorrTableProducer { // global variable mass_win_map = {{kCentralWindow, cfg_lambda_mass}, {kLeftWindow, cfg_lambda_left}, {kRightWindow, cfg_lambda_right}}; + const AxisSpec axisCol(5, 0, 5, ""); const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); @@ -213,27 +216,26 @@ 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}); // 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/h2d_n1_V0_ptmass", "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}); // QA Lambda - histos.add("QA_Sel_Lambda/h1d_pos_prong_pt", "Pos-Prong p_{T}", kTH1F, {axisV0Pt}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_pt", "Neg-Prong p_{T}", kTH1F, {axisV0Pt}); - histos.add("QA_Sel_Lambda/h1d_pos_prong_eta", "Pos-Prong #eta-distribution", kTH1F, {axisV0Rap}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_eta", "Neg-Prong #eta-distribution", kTH1F, {axisV0Rap}); - 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/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, {axisV0Rap}); 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_n1_V0_pteta", "p_{T} vs #eta", kTH2F, {axisV0Rap, axisV0Pt}); + histos.add("QA_Sel_Lambda/h2d_n1_V0_ptrap", "p_{T} vs y", kTH2F, {axisV0Rap, axisV0Pt}); + histos.add("QA_Sel_Lambda/h2d_n1_V0_ptphi", "p_{T} vs #phi", kTH2F, {axisV0Phi, 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}); @@ -243,6 +245,13 @@ struct lambdaCorrTableProducer { 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_pos_prong_pt", "Pos-Prong p_{T}", kTH1F, {axisV0Pt}); + histos.add("QA_Sel_Lambda/h1d_neg_prong_pt", "Neg-Prong p_{T}", kTH1F, {axisV0Pt}); + histos.add("QA_Sel_Lambda/h1d_pos_prong_eta", "Pos-Prong #eta-distribution", kTH1F, {axisV0Rap}); + histos.add("QA_Sel_Lambda/h1d_neg_prong_eta", "Neg-Prong #eta-distribution", kTH1F, {axisV0Rap}); + 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_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_nsigma_pr_tpc", "TPC n#sigma Pos-Prong", kTH2F, {axisMomPID, axisNsigma}); @@ -261,15 +270,22 @@ struct lambdaCorrTableProducer { // MC Generated Histograms if (doprocessMCGen) { - histos.add("MCGen/h1d_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); - histos.add("MCGen/h1d_pt_lambda", "#Lambda p_{T}", kTH1F, {axisV0Pt}); - histos.add("MCGen/h1d_pt_antilambda", "#bar{#Lambda} p_{T}", kTH1F, {axisV0Pt}); - histos.add("MCGen/h1d_eta_lambda", "#Lambda #eta-distribution", kTH1F, {axisV0Rap}); - histos.add("MCGen/h1d_eta_antilambda", "#bar{#Lambda} #eta-distribution", kTH1F, {axisV0Rap}); - histos.add("MCGen/h1d_y_lambda", "#Lambda y-distribution", kTH1F, {axisV0Rap}); - histos.add("MCGen/h1d_y_antilambda", "#bar{#Lambda} y-distribution", kTH1F, {axisV0Rap}); - histos.add("MCGen/h1d_phi_lambda", "#Lambda #phi-distribution", kTH1F, {axisV0Phi}); - histos.add("MCGen/h1d_phi_antilambda", "#bar{#Lambda} #phi-distribution", kTH1F, {axisV0Phi}); + 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_pt_lambda", "#Lambda p_{T}", kTH1F, {axisV0Pt}); + histos.add("McGen/h1d_eta_lambda", "#Lambda #eta-distribution", kTH1F, {axisV0Rap}); + 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, {axisV0Rap, 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_pt_antilambda", "#bar{#Lambda} p_{T}", kTH1F, {axisV0Pt}); + histos.add("McGen/h1d_eta_antilambda", "#bar{#Lambda} #eta-distribution", kTH1F, {axisV0Rap}); + 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, {axisV0Rap, 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}); } } @@ -390,7 +406,7 @@ struct lambdaCorrTableProducer { break; } - if (track.hasTOF()) { + if (!cfg_tpc_only && track.hasTOF()) { if (fabs(tofNSigma) < cfg_tof_nsigma) { selTOFv0type = true; } @@ -438,6 +454,9 @@ struct lambdaCorrTableProducer { 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_pt_vs_alpha"), v0.alpha(), v0.qtarm()); + histos.fill(HIST(sub_dir[part]) + HIST("h2d_n1_V0_pteta"), v0.eta(), v0.pt()); + histos.fill(HIST(sub_dir[part]) + HIST("h2d_n1_V0_ptrap"), v0.yLambda(), v0.pt()); + histos.fill(HIST(sub_dir[part]) + HIST("h2d_n1_V0_ptphi"), v0.phi(), 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"), fabs(v0.dcapostopv())); @@ -462,12 +481,12 @@ struct lambdaCorrTableProducer { histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_nsigma_pr_tpc"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPr()); histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_nsigma_pi_tpc"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPi()); - if (postrack.hasTOF()) { + if (!cfg_tpc_only && postrack.hasTOF()) { histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_nsigma_pr_tof"), postrack.tofExpMom(), postrack.tofNSigmaPr()); histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_nsigma_pi_tof"), postrack.tofExpMom(), postrack.tofNSigmaPi()); } - if (negtrack.hasTOF()) { + if (!cfg_tpc_only && negtrack.hasTOF()) { histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_nsigma_pr_tof"), negtrack.tofExpMom(), negtrack.tofNSigmaPr()); histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_nsigma_pi_tof"), negtrack.tofExpMom(), negtrack.tofNSigmaPi()); } @@ -496,6 +515,7 @@ struct lambdaCorrTableProducer { 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 mass window selection [global] @@ -521,6 +541,8 @@ struct lambdaCorrTableProducer { return; } + histos.fill(HIST("QA_Checks/h1d_tracks_info"), 4.5); + // apply MC Reco cuts if constexpr (reco) { @@ -540,7 +562,9 @@ struct lambdaCorrTableProducer { } // fill mass histogram before mass window cuts + histos.fill(HIST("QA_Checks/h1d_tracks_info"), 5.5); histos.fill(HIST("QA_Checks/h1d_lambda_mass"), mass); + histos.fill(HIST("QA_Checks/h2d_n1_V0_ptmass"), mass, v0track.pt()); // loop over mass windows for (auto m = mass_win_map.begin(); m != mass_win_map.end(); ++m) { @@ -569,17 +593,21 @@ 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 @@ -587,6 +615,7 @@ struct lambdaCorrTableProducer { 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); @@ -613,16 +642,21 @@ struct lambdaCorrTableProducer { for (auto const& collision : collisions) { - // check for corresponding MCGen Collision - if (!collision.has_mcCollision()) { - return; - } + histos.fill(HIST("Event/h1d_collisions_info"), 1.5); // select collision if (!selCol(collision)) { - return; + 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()); @@ -633,11 +667,14 @@ struct lambdaCorrTableProducer { 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 (!v0.has_mcParticle()) { + 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 @@ -645,6 +682,7 @@ struct lambdaCorrTableProducer { 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); @@ -657,12 +695,15 @@ struct lambdaCorrTableProducer { void processMCGen(McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) { + histos.fill(HIST("McGen/h1d_collisions_info"), 1.5); + // apply collision cuts if (fabs(mcCollision.posZ()) > cfg_z_vtx) { return; } - histos.fill(HIST("MCGen/h1d_collision_posZ"), mcCollision.posZ()); + histos.fill(HIST("McGen/h1d_collisions_info"), 2.5); + histos.fill(HIST("McGen/h1d_collision_posZ"), mcCollision.posZ()); lambdaMCGenCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); TLorentzVector p; @@ -716,16 +757,22 @@ struct lambdaCorrTableProducer { // Fill histograms if (mcpart.pdgCode() == 3122) { - 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/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.pt(), rap, mcpart.phi(), p.M(), postrackid, negtrackid, (int8_t)kLambda); } else if (mcpart.pdgCode() == -3122) { - 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/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.pt(), rap, mcpart.phi(), p.M(), postrackid, negtrackid, (int8_t)kAntiLambda); } } @@ -777,7 +824,7 @@ 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(40, 0.5, 2.5, "p_{T} (GeV/#it{c})"); + const AxisSpec axisPt(60, 0.2, 3.2, "p_{T} (GeV/#it{c})"); const AxisSpec axisRap(cfg_nRapBins, cfg_Rap_Min, cfg_Rap_Max, "rap"); const AxisSpec axisPhi(cfg_nPhiBins, cfg_Phi_Min, cfg_Phi_Max, "#phi (rad)"); const AxisSpec axisRapPhi(knrapphibins, kminrapphi, kmaxrapphi, "rap #phi"); @@ -796,6 +843,11 @@ struct lambdaCorrelationAnalysis { histos.addClone("Reco/Lambda/", "Reco/AntiLambda/"); // single and two particle densities + histos.add("Reco/Lambda_Mass/h2d_n1_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisRap, axisPhi}); + histos.add("Reco/Lambda_Mass/h2d_n1_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisRap, axisPhi}); + histos.add("Reco/Lambda_Mass/h2d_n2_LaP_LaM", "#rho_{2}^{#Lambda - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); + histos.add("Reco/Lambda_Mass/h2d_n2_LaP_LaP", "#rho_{2}^{#Lambda - #Lambda}", kTH2D, {axisRapPhi, axisRapPhi}); + histos.add("Reco/Lambda_Mass/h2d_n2_LaM_LaM", "#rho_{2}^{#bar{#Lambda} - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); histos.add("Reco/Lambda_Mass/h2d_n2_pt1pt2_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2D, {axisPt, axisPt}); histos.add("Reco/Lambda_Mass/h2d_n2_pt1pt2_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2D, {axisPt, axisPt}); histos.add("Reco/Lambda_Mass/h2d_n2_pt1pt2_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2D, {axisPt, axisPt}); @@ -811,11 +863,6 @@ struct lambdaCorrelationAnalysis { histos.add("Reco/Lambda_Mass/h2d_n2_pt1phi2_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2D, {axisPt, axisPhi}); histos.add("Reco/Lambda_Mass/h2d_n2_pt1phi2_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2D, {axisPt, axisPhi}); histos.add("Reco/Lambda_Mass/h2d_n2_pt1phi2_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2D, {axisPt, axisPhi}); - histos.add("Reco/Lambda_Mass/h2d_n1_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisRap, axisPhi}); - histos.add("Reco/Lambda_Mass/h2d_n1_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisRap, axisPhi}); - histos.add("Reco/Lambda_Mass/h2d_n2_LaP_LaM", "#rho_{2}^{#Lambda - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); - histos.add("Reco/Lambda_Mass/h2d_n2_LaP_LaP", "#rho_{2}^{#Lambda - #Lambda}", kTH2D, {axisRapPhi, axisRapPhi}); - histos.add("Reco/Lambda_Mass/h2d_n2_LaM_LaM", "#rho_{2}^{#bar{#Lambda} - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); histos.addClone("Reco/Lambda_Mass/", "Reco/Lambda_Right/"); histos.addClone("Reco/Lambda_Mass/", "Reco/Lambda_Left/"); @@ -865,14 +912,14 @@ struct lambdaCorrelationAnalysis { static constexpr std::string_view sub_dir_recgen[] = {"Reco/", "McGen/"}; static constexpr std::string_view sub_dir_part[] = {"Lambda/", "AntiLambda/"}; static constexpr std::string_view sub_dir_mass_win[] = {"Lambda_Mass/", "Lambda_Left/", "Lambda_Right/"}; - static constexpr std::string_view sub_dir_hist[] = {"h2d_n1_LaP", "h2d_n1_LaM"}; + static constexpr std::string_view sub_dir_hist[] = {"LaP", "LaM"}; int ntrk = 0; for (auto const& track : tracks) { ++ntrk; histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir_part[part]) + HIST("h1d_inv_mass"), track.mass()); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir_mass_win[masswin]) + HIST(sub_dir_hist[part]), track.rap(), track.phi()); + histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir_mass_win[masswin]) + HIST("h2d_n1_") + HIST(sub_dir_hist[part]), track.rap(), track.phi()); } if (masswin == kCentralWindow && ntrk != 0) { @@ -890,7 +937,7 @@ struct lambdaCorrelationAnalysis { for (auto const& trk_1 : trks_1) { for (auto const& trk_2 : trks_2) { - if (samelambda && (trk_1.index() == trk_2.index()) && (trk_1.postrackid() == trk_2.postrackid()) && (trk_1.negtrackid() == trk_2.negtrackid())) { + if (samelambda && ((trk_1.index() == trk_2.index()) || (trk_1.postrackid() == trk_2.postrackid()) || (trk_1.negtrackid() == trk_2.negtrackid()))) { continue; } fillPairHistos(trk_1, trk_2); @@ -968,8 +1015,8 @@ struct lambdaCorrelationAnalysis { analyzeSingles(lambda_mcgen_tracks); analyzeSingles(antilambda_mcgen_tracks); analyzePairs(lambda_mcgen_tracks, antilambda_mcgen_tracks); - analyzePairs(lambda_mcgen_tracks, antilambda_mcgen_tracks); - analyzePairs(lambda_mcgen_tracks, antilambda_mcgen_tracks); + analyzePairs(lambda_mcgen_tracks, lambda_mcgen_tracks); + analyzePairs(antilambda_mcgen_tracks, antilambda_mcgen_tracks); } PROCESS_SWITCH(lambdaCorrelationAnalysis, processMCGen, "Process for MC Generated", false); From 867320fc1b9dab838c253b46e13b339ed0823c6c Mon Sep 17 00:00:00 2001 From: HANSEO PARK <53218370+hanseopark@users.noreply.github.com> Date: Sat, 7 Sep 2024 03:37:06 +0200 Subject: [PATCH 48/60] [PWGJE] Add histograms of tagged jet for sv (#7597) * divide task for tagging * Add tagged jet for sv * fix clang-format --- PWGJE/Tasks/jettaggerhfQA.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/PWGJE/Tasks/jettaggerhfQA.cxx b/PWGJE/Tasks/jettaggerhfQA.cxx index 43794ae132e..9bbe0f41cef 100644 --- a/PWGJE/Tasks/jettaggerhfQA.cxx +++ b/PWGJE/Tasks/jettaggerhfQA.cxx @@ -313,6 +313,9 @@ struct JetTaggerHFQA { registry.add("h3_jet_pt_2prong_Sxy_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_2prong_Sxyz_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_2prong_mass_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_2prong_Sxy_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_2prong_Sxyz_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_2prong_mass_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); } if (doprocessSV3ProngMCD || doprocessSV3ProngMCDWeighted) { registry.add("h2_3prong_nprongs_flavour", "", {HistType::kTH2F, {{nprongsAxis}, {jetFlavourAxis}}}); @@ -325,6 +328,9 @@ struct JetTaggerHFQA { registry.add("h3_jet_pt_3prong_Sxy_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_3prong_Sxyz_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_3prong_mass_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_3prong_Sxy_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_3prong_Sxyz_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_3prong_mass_N1_flavour", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); } if (doprocessSV2ProngMCPMCDMatched || doprocessSV2ProngMCPMCDMatchedWeighted) { registry.add("h3_jet_pt_2prong_Lxy_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {LxyAxis}, {jetFlavourAxis}}}); @@ -347,6 +353,9 @@ struct JetTaggerHFQA { registry.add("h3_jet_pt_3prong_Sxy_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_3prong_Sxyz_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); registry.add("h3_jet_pt_3prong_mass_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_3prong_Sxy_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_3prong_Sxyz_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {SxyzAxis}, {jetFlavourAxis}}}); + registry.add("h3_taggedjet_pt_3prong_mass_N1_flavour_run2", "", {HistType::kTH3F, {{jetPtAxis}, {massAxis}, {jetFlavourAxis}}}); } } @@ -855,6 +864,11 @@ struct JetTaggerHFQA { registry.fill(HIST("h3_jet_pt_2prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin, eventWeight); registry.fill(HIST("h3_jet_pt_2prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin, eventWeight); registry.fill(HIST("h3_jet_pt_2prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin, eventWeight); + if (!mcdjet.flagtaggedjetSV()) + return; + registry.fill(HIST("h3_taggedjet_pt_2prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin, eventWeight); + registry.fill(HIST("h3_taggedjet_pt_2prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin, eventWeight); + registry.fill(HIST("h3_taggedjet_pt_2prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin, eventWeight); } template @@ -925,6 +939,11 @@ struct JetTaggerHFQA { registry.fill(HIST("h3_jet_pt_3prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin, eventWeight); registry.fill(HIST("h3_jet_pt_3prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin, eventWeight); registry.fill(HIST("h3_jet_pt_3prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin, eventWeight); + if (!mcdjet.flagtaggedjetSV()) + return; + registry.fill(HIST("h3_taggedjet_pt_3prong_Sxy_N1_flavour"), mcdjet.pt(), maxSxy, origin, eventWeight); + registry.fill(HIST("h3_taggedjet_pt_3prong_Sxyz_N1_flavour"), mcdjet.pt(), maxSxyz, origin, eventWeight); + registry.fill(HIST("h3_taggedjet_pt_3prong_mass_N1_flavour"), mcdjet.pt(), massSV, origin, eventWeight); } template @@ -962,6 +981,11 @@ struct JetTaggerHFQA { registry.fill(HIST("h3_jet_pt_3prong_Sxy_N1_flavour_run2"), mcdjet.pt(), maxSxy, jetflavourRun2Def, eventWeight); registry.fill(HIST("h3_jet_pt_3prong_Sxyz_N1_flavour_run2"), mcdjet.pt(), maxSxyz, jetflavourRun2Def, eventWeight); registry.fill(HIST("h3_jet_pt_3prong_mass_N1_flavour_run2"), mcdjet.pt(), massSV, jetflavourRun2Def, eventWeight); + if (!mcdjet.flagtaggedjetSV()) + return; + registry.fill(HIST("h3_taggedjet_pt_3prong_Sxy_N1_flavour_run2"), mcdjet.pt(), maxSxy, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_taggedjet_pt_3prong_Sxyz_N1_flavour_run2"), mcdjet.pt(), maxSxyz, jetflavourRun2Def, eventWeight); + registry.fill(HIST("h3_taggedjet_pt_3prong_mass_N1_flavour_run2"), mcdjet.pt(), massSV, jetflavourRun2Def, eventWeight); } void processDummy(aod::Collision const&, aod::Tracks const&) From 37b179e960a7e2ef394682e7bb5ccdc678eec884 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Sat, 7 Sep 2024 04:49:04 +0200 Subject: [PATCH 49/60] add mc process function (#7598) * add mc process function * Please consider the following formatting changes * fix type --------- Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 83 ++++++++++++++++++++---- 1 file changed, 69 insertions(+), 14 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 5f6d8e7aa00..2c70f10f348 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -409,6 +409,26 @@ struct ebyeMaker { 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); + 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 = multFV0A * Run2V0MInfo.mhVtxAmpCorrV0A->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0A->FindFixBin(zvtx)) + + multFV0C * Run2V0MInfo.mhVtxAmpCorrV0C->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0C->FindFixBin(zvtx)); + + return v0m; + } + template int getTrackSelMask(T const& track) { @@ -1017,20 +1037,7 @@ struct ebyeMaker { if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) continue; - auto fv0a = fv0as.rawIteratorAt(bc.globalIndex()); - auto fv0c = fv0cs.rawIteratorAt(bc.globalIndex()); - float multFV0A = 0; - float multFV0C = 0; - for (float amplitude : fv0a.amplitude()) { - multFV0A += amplitude; - } - - for (float amplitude : fv0c.amplitude()) { - multFV0C += amplitude; - } - - float v0m = multFV0A * Run2V0MInfo.mhVtxAmpCorrV0A->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0A->FindFixBin(collision.posZ())) + - multFV0C * Run2V0MInfo.mhVtxAmpCorrV0C->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0C->FindFixBin(collision.posZ())); + 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()); @@ -1194,6 +1201,54 @@ 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&) + { + + for (const auto& collision : collisions) { + auto bc = collision.bc_as(); + initCCDB(bc); + + if (std::abs(collision.posZ()) > zVtxMax) + continue; + + 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)); + + histos.fill(HIST("QA/zVtx"), collision.posZ()); + + const uint64_t collIdx = collision.globalIndex(); + auto V0Table_thisCollision = V0s.sliceBy(perCollisionV0, collIdx); + V0Table_thisCollision.bindExternalIndices(&tracks); + + fillMcEvent(collision, tracks, V0Table_thisCollision, cV0M, mcParticles, mcLab); + fillMcGen(mcParticles, mcLab, collision.mcCollisionId()); + + miniCollTable(std::abs(collision.posZ()), 0x0, nTrackletsColl, cV0M); + + for (auto& candidateTrack : candidateTracks[0]) { // protons + auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); + float outerPID = getOuterPID(tk); + candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID; + int selMask = getTrackSelMask(candidateTrack); + if (candidateTrack.outerPID < -4) + continue; + mcMiniTrkTable( + miniCollTable.lastIndex(), + candidateTrack.pt, + std::abs(candidateTrack.eta) * 10., + selMask, + candidateTrack.outerPID, + candidateTrack.genpt, + candidateTrack.geneta, + candidateTrack.isreco); + } + } + } + PROCESS_SWITCH(ebyeMaker, processMiniMcRun2, "process mini tables for mc(Run 2)", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 436b7717b06877242313a9b08007df59df17c43d Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sat, 7 Sep 2024 08:44:07 +0200 Subject: [PATCH 50/60] PWGEM/PhotonMeson: quick fix after #7491 (#7602) --- PWGEM/Dilepton/Core/PhotonHBT.h | 23 ++++++----- .../TableProducer/createEMEventDilepton.cxx | 2 +- .../TableProducer/photonconversionbuilder.cxx | 40 +++++++++++-------- PWGEM/PhotonMeson/Tasks/pcmQC.cxx | 17 ++++---- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 18 +++++---- 5 files changed, 56 insertions(+), 44 deletions(-) diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index 2491ba70d96..5d08c0be583 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -408,14 +408,14 @@ struct PhotonHBT { const AxisSpec axis_qside{60, -0.3, +0.3, "q_{side} (GeV/c)"}; // qside does not change between LAB and LCMS frame const AxisSpec axis_qlong{60, -0.3, +0.3, "q_{long} (GeV/c)"}; - 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); - } - 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); + } } if constexpr (pairtype == ggHBTPairType::kPCMPCM) { // dr, dz of conversion points @@ -611,13 +611,14 @@ struct PhotonHBT { // float qabs_lcms_tmp = q12_lcms.P(); // LOGF(info, "qabs_lcms = %f, qabs_lcms_tmp = %f", qabs_lcms, qabs_lcms_tmp); - 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); - } else { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_1d"), kstar, qabs_lcms, kt, weight); - } if (cfgDo3D) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_3d"), qout_lcms, qside_lcms, qlong_lcms, kt, weight); + } 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); + } else { + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_1d"), kstar, qabs_lcms, kt, weight); + } } } diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index fb727ffd41d..603c97138ff 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -341,7 +341,7 @@ struct EMEventPropertyTask { } spherocity_cuts; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - void init(InitContext& initContext) + void init(InitContext&) { if (fillQAHistogram) { fRegistry.add("Spherocity/hPt", "pT;p_{T} (GeV/c)", kTH1F, {{200, 0.0f, 10}}, false); diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 4a625357f47..226801fcc61 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -86,6 +86,7 @@ struct PhotonConversionBuilder { Configurable min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"}; Configurable mincrossedrows{"mincrossedrows", 40, "min crossed rows"}; Configurable moveTPCTracks{"moveTPCTracks", true, "Move TPC-only tracks under the collision assumption"}; + Configurable disableITSonlyTracks{"disableITSonlyTracks", false, "disable ITSonly tracks in V0 legs"}; Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max chi2/NclsTPC"}; // default 4.0 + 1.0 Configurable maxchi2its{"maxchi2its", 6.0, "max chi2/NclsITS"}; // default 5.0 + 1.0 @@ -269,6 +270,10 @@ struct PhotonConversionBuilder { } } + if (disableITSonlyTracks && isITSonlyTrack(track)) { + return false; + } + if (track.x() > maxX) { return false; } @@ -360,8 +365,8 @@ struct PhotonConversionBuilder { return cospaRZ; } - template - void fillTrackTable(TTrack const& track, TKFParticle const& kfp, float dcaXY, float dcaZ) + template + void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ) { v0legs(track.collisionId(), track.globalIndex(), track.sign(), kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), dcaXY, dcaZ, @@ -369,7 +374,7 @@ struct PhotonConversionBuilder { track.tpcChi2NCl(), track.tpcInnerParam(), track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaPi(), track.itsClusterSizes(), track.itsChi2NCl(), track.detectorMap(), - track.x(), track.y(), track.z(), track.tgl()); + shiftedtrack.getX(), shiftedtrack.getY(), shiftedtrack.getZ(), shiftedtrack.getTgl()); } template @@ -441,7 +446,7 @@ struct PhotonConversionBuilder { if (rxy_tmp > maxX + margin_r_tpc) { return; } - if (rxy_tmp < abs(xyz[2]) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-max_eta_v0))) - margin_z) { + if (rxy_tmp < fabs(xyz[2]) * std::tan(2 * std::atan(std::exp(-max_eta_v0))) - margin_z) { return; // RZ line cut } @@ -479,7 +484,7 @@ struct PhotonConversionBuilder { if (rxy > maxX + margin_r_tpc) { return; } - if (rxy < abs(gammaKF_DecayVtx.GetZ()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-max_eta_v0))) - margin_z) { + if (rxy < fabs(gammaKF_DecayVtx.GetZ()) * std::tan(2 * std::atan(std::exp(-max_eta_v0))) - margin_z) { return; // RZ line cut } if (rxy < min_v0radius) { @@ -488,30 +493,30 @@ struct PhotonConversionBuilder { if (!filltable) { if (isITSTPCTrack(pos) && isITSTPCTrack(ele)) { - registry.fill(HIST("V0/hRxy_minX_ITSTPC_ITSTPC"), std::min(pos.x(), ele.x()), std::min(pos.x(), ele.x()) - rxy); // trackiu.x() - rxy should be positive + registry.fill(HIST("V0/hRxy_minX_ITSTPC_ITSTPC"), std::min(pTrack.getX(), nTrack.getX()), std::min(pTrack.getX(), nTrack.getX()) - rxy); // trackiu.x() - rxy should be positive } else if (isITSonlyTrack(pos) && isITSonlyTrack(ele)) { - registry.fill(HIST("V0/hRxy_minX_ITSonly_ITSonly"), std::min(pos.x(), ele.x()), std::min(pos.x(), ele.x()) - rxy); // trackiu.x() - rxy should be positive + registry.fill(HIST("V0/hRxy_minX_ITSonly_ITSonly"), std::min(pTrack.getX(), nTrack.getX()), std::min(pTrack.getX(), nTrack.getX()) - rxy); // trackiu.x() - rxy should be positive } else if ((isITSTPCTrack(pos) && isITSonlyTrack(ele)) || (isITSTPCTrack(ele) && isITSonlyTrack(pos))) { - registry.fill(HIST("V0/hRxy_minX_ITSTPC_ITSonly"), std::min(pos.x(), ele.x()), std::min(pos.x(), ele.x()) - rxy); // trackiu.x() - rxy should be positive + registry.fill(HIST("V0/hRxy_minX_ITSTPC_ITSonly"), std::min(pTrack.getX(), nTrack.getX()), std::min(pTrack.getX(), nTrack.getX()) - rxy); // trackiu.x() - rxy should be positive } else if (isITSTPCTrack(pos) && !ele.hasITS()) { - registry.fill(HIST("V0/hRxy_minX_ITSTPC_TPC"), std::min(pos.x(), 83.f), std::min(pos.x(), 83.f) - rxy); // trackiu.x() - rxy should be positive + registry.fill(HIST("V0/hRxy_minX_ITSTPC_TPC"), std::min(pTrack.getX(), 83.f), std::min(pTrack.getX(), 83.f) - rxy); // trackiu.x() - rxy should be positive } else if (isITSTPCTrack(ele) && !pos.hasITS()) { - registry.fill(HIST("V0/hRxy_minX_ITSTPC_TPC"), std::min(ele.x(), 83.f), std::min(ele.x(), 83.f) - rxy); // trackiu.x() - rxy should be positive + registry.fill(HIST("V0/hRxy_minX_ITSTPC_TPC"), std::min(nTrack.getX(), 83.f), std::min(nTrack.getX(), 83.f) - rxy); // trackiu.x() - rxy should be positive } else { registry.fill(HIST("V0/hRxy_minX_TPC_TPC"), std::min(83.f, 83.f), std::min(83.f, 83.f) - rxy); // trackiu.x() - rxy should be positive } } if (pos.hasITS() && ele.hasITS()) { // ITSonly-ITSonly, ITSTPC-ITSTPC, ITSTPC-ITSonly - if (rxy > std::min(pos.x(), ele.x()) + margin_r_its) { + if (rxy > std::min(pTrack.getX(), nTrack.getX()) + margin_r_its) { return; } } else if (!pos.hasITS() && ele.hasITS()) { // ITSTPC-TPC - if (rxy > std::min(83.f, ele.x()) + margin_r_itstpc_tpc) { + if (rxy > std::min(83.f, nTrack.getX()) + margin_r_itstpc_tpc) { return; } } else if (pos.hasITS() && !ele.hasITS()) { // ITSTPC-TPC - if (rxy > std::min(pos.x(), 83.f) + margin_r_itstpc_tpc) { + if (rxy > std::min(pTrack.getX(), 83.f) + margin_r_itstpc_tpc) { return; } } else if (!pos.hasITS() && !ele.hasITS()) { // TPC-TPC @@ -624,7 +629,7 @@ struct PhotonConversionBuilder { registry.fill(HIST("V0/hPCA_CosPA"), cospa_kf, pca_kf); registry.fill(HIST("V0/hPCA_Rxy"), rxy, pca_kf); registry.fill(HIST("V0/hDCAxyz"), dca_xy_v0_to_pv, dca_z_v0_to_pv); - registry.fill(HIST("V0/hPCA_diffX"), pca_kf, std::min(pos.x(), ele.x()) - rxy); // trackiu.x() - rxy should be positive + registry.fill(HIST("V0/hPCA_diffX"), pca_kf, std::min(pTrack.getX(), nTrack.getX()) - rxy); // trackiu.x() - rxy should be positive float cospaXY_kf = cospaXY_KF(gammaKF_DecayVtx, KFPV); float cospaRZ_kf = cospaRZ_KF(gammaKF_DecayVtx, KFPV); @@ -644,8 +649,9 @@ struct PhotonConversionBuilder { for (auto& leg : {pos, ele}) { registry.fill(HIST("V0Leg/hdEdx_Pin"), leg.tpcInnerParam(), leg.tpcSignal()); registry.fill(HIST("V0Leg/hTPCNsigmaEl"), leg.tpcInnerParam(), leg.tpcNSigmaEl()); - registry.fill(HIST("V0Leg/hXZ"), leg.z(), leg.x()); } // end of leg loop + registry.fill(HIST("V0Leg/hXZ"), pTrack.getZ(), pTrack.getX()); + registry.fill(HIST("V0Leg/hXZ"), nTrack.getZ(), nTrack.getX()); registry.fill(HIST("V0Leg/hDCAxyz"), posdcaXY, posdcaZ); registry.fill(HIST("V0Leg/hDCAxyz"), eledcaXY, eledcaZ); @@ -660,8 +666,8 @@ struct PhotonConversionBuilder { v0_sv.M(), dca_xy_v0_to_pv, dca_z_v0_to_pv, cospa_kf, pca_kf, alpha, qt, chi2kf); - fillTrackTable(pos, kfp_pos_DecayVtx, posdcaXY, posdcaZ); // positive leg first - fillTrackTable(ele, kfp_ele_DecayVtx, eledcaXY, eledcaZ); // negative leg second + fillTrackTable(pos, pTrack, kfp_pos_DecayVtx, posdcaXY, posdcaZ); // positive leg first + fillTrackTable(ele, nTrack, kfp_ele_DecayVtx, eledcaXY, eledcaZ); // negative leg second } // end of fill table } diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index a0adce9a15f..49f734c1a9d 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -122,7 +122,7 @@ struct PCMQC { // v0 info fRegistry.add("V0/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false); - fRegistry.add("V0/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{36, 0, 2 * M_PI}, {20, -1.0f, 1.0f}}, false); + fRegistry.add("V0/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); fRegistry.add("V0/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false); fRegistry.add("V0/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.9f, 1.0f}}, false); fRegistry.add("V0/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.9f, 1.0f}}, false); @@ -143,7 +143,7 @@ struct PCMQC { // v0leg info fRegistry.add("V0Leg/hPt", "pT;p_{T,e} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false); fRegistry.add("V0Leg/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -50, 50}}, false); - fRegistry.add("V0Leg/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{180, 0, 2 * M_PI}, {40, -2.0f, 2.0f}}, false); + fRegistry.add("V0Leg/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); fRegistry.add("V0Leg/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -50.0f, 50.0f}, {200, -50.0f, 50.0f}}, false); fRegistry.add("V0Leg/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("V0Leg/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false); @@ -156,10 +156,10 @@ struct PCMQC { fRegistry.add("V0Leg/hNclsITS", "number of ITS clusters", kTH1F, {{8, -0.5, 7.5}}, false); fRegistry.add("V0Leg/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{100, 0, 10}}, false); fRegistry.add("V0Leg/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("V0Leg/hMeanClusterSizeITS", "mean cluster size ITS; on ITS #times cos(#lambda)", kTH1F, {{32, 0, 16}}, false); - fRegistry.add("V0Leg/hXY", "X vs. Y;X (cm);Y (cm)", kTH2F, {{100, 0, 100}, {100, -50, 50}}, false); + fRegistry.add("V0Leg/hMeanClusterSizeITS", "mean cluster size ITS; on ITS #times cos(#lambda)", kTH2F, {{1000, 0, 10}, {160, 0, 16}}, false); + fRegistry.add("V0Leg/hXY", "X vs. Y;X (cm);Y (cm)", kTH2F, {{100, 0, 100}, {80, -20, 20}}, false); fRegistry.add("V0Leg/hZX", "Z vs. X;Z (cm);X (cm)", kTH2F, {{200, -100, 100}, {100, 0, 100}}, false); - fRegistry.add("V0Leg/hZY", "Z vs. Y;Z (cm);Y (cm)", kTH2F, {{200, -100, 100}, {100, -50, 50}}, false); + fRegistry.add("V0Leg/hZY", "Z vs. Y;Z (cm);Y (cm)", kTH2F, {{200, -100, 100}, {80, -20, 20}}, false); } void DefineEMEventCut() @@ -309,7 +309,9 @@ struct PCMQC { fRegistry.fill(HIST("V0Leg/hChi2TPC"), leg.tpcChi2NCl()); fRegistry.fill(HIST("V0Leg/hChi2ITS"), leg.itsChi2NCl()); fRegistry.fill(HIST("V0Leg/hITSClusterMap"), leg.itsClusterMap()); - fRegistry.fill(HIST("V0Leg/hMeanClusterSizeITS"), leg.meanClusterSizeITS() * std::cos(std::atan(leg.tgl()))); + if (leg.hasITS()) { + fRegistry.fill(HIST("V0Leg/hMeanClusterSizeITS"), leg.p(), leg.meanClusterSizeITS() * std::cos(std::atan(leg.tgl()))); + } fRegistry.fill(HIST("V0Leg/hTPCdEdx"), leg.tpcInnerParam(), leg.tpcSignal()); fRegistry.fill(HIST("V0Leg/hTPCNsigmaEl"), leg.tpcInnerParam(), leg.tpcNSigmaEl()); fRegistry.fill(HIST("V0Leg/hTPCNsigmaPi"), leg.tpcInnerParam(), leg.tpcNSigmaPi()); @@ -344,6 +346,7 @@ struct PCMQC { for (auto& v0 : v0photons_coll) { auto pos = v0.posTrack_as(); auto ele = v0.negTrack_as(); + if (!fV0PhotonCut.IsSelected(v0)) { continue; } @@ -355,7 +358,7 @@ struct PCMQC { } // end of v0 loop fRegistry.fill(HIST("V0/hNgamma"), nv0); } // end of collision loop - } // end of process + } // end of process void processDummy(MyCollisions const&) {} diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index 4f7dc79ce23..279c0a57c80 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -164,7 +164,7 @@ struct PCMQCMC { // v0 info fRegistry.add("V0/primary/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false); - fRegistry.add("V0/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{36, 0, 2 * M_PI}, {20, -1.0f, 1.0f}}, false); + fRegistry.add("V0/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); fRegistry.add("V0/primary/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false); fRegistry.add("V0/primary/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.9f, 1.0f}}, false); fRegistry.add("V0/primary/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.9f, 1.0f}}, false); @@ -195,7 +195,7 @@ struct PCMQCMC { // v0leg info fRegistry.add("V0Leg/primary/hPt", "pT;p_{T,e} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false); fRegistry.add("V0Leg/primary/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -50, 50}}, false); - fRegistry.add("V0Leg/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{180, 0, 2 * M_PI}, {40, -2.0f, 2.0f}}, false); + fRegistry.add("V0Leg/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -3.0f, 1.0f}}, false); fRegistry.add("V0Leg/primary/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -50.0f, 50.0f}, {200, -50.0f, 50.0f}}, false); fRegistry.add("V0Leg/primary/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("V0Leg/primary/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false); @@ -208,10 +208,10 @@ struct PCMQCMC { fRegistry.add("V0Leg/primary/hNclsITS", "number of ITS clusters", kTH1F, {{8, -0.5, 7.5}}, false); fRegistry.add("V0Leg/primary/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{100, 0, 10}}, false); fRegistry.add("V0Leg/primary/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("V0Leg/primary/hMeanClusterSizeITS", "mean cluster size ITS; on ITS #times cos(#lambda)", kTH1F, {{32, 0, 16}}, false); - fRegistry.add("V0Leg/primary/hXY", "X vs. Y;X (cm);Y (cm)", kTH2F, {{100, 0, 100}, {100, -50, 50}}, false); + fRegistry.add("V0Leg/primary/hMeanClusterSizeITS", "mean cluster size ITS; on ITS #times cos(#lambda)", kTH2F, {{1000, 0, 10}, {160, 0, 16}}, false); + fRegistry.add("V0Leg/primary/hXY", "X vs. Y;X (cm);Y (cm)", kTH2F, {{100, 0, 100}, {40, -20, 20}}, false); fRegistry.add("V0Leg/primary/hZX", "Z vs. X;Z (cm);X (cm)", kTH2F, {{200, -100, 100}, {100, 0, 100}}, false); - fRegistry.add("V0Leg/primary/hZY", "Z vs. Y;Z (cm);Y (cm)", kTH2F, {{200, -100, 100}, {100, -50, 50}}, false); + fRegistry.add("V0Leg/primary/hZY", "Z vs. Y;Z (cm);Y (cm)", kTH2F, {{200, -100, 100}, {40, -20, 20}}, false); fRegistry.add("V0Leg/primary/hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", kTH2F, {{1000, 0, 10}, {400, -1.0f, 1.0f}}, true); fRegistry.add("V0Leg/primary/hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", kTH2F, {{1000, 0, 10}, {400, -1.0f, 1.0f}}, true); fRegistry.add("V0Leg/primary/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{1000, 0, 10}, {400, -1.0f, 1.0f}}, true); @@ -374,7 +374,9 @@ struct PCMQCMC { fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hChi2TPC"), leg.tpcChi2NCl()); fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hChi2ITS"), leg.itsChi2NCl()); fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hITSClusterMap"), leg.itsClusterMap()); - fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hMeanClusterSizeITS"), leg.meanClusterSizeITS() * std::cos(std::atan(leg.tgl()))); + if (leg.hasITS()) { + fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hMeanClusterSizeITS"), leg.p(), leg.meanClusterSizeITS() * std::cos(std::atan(leg.tgl()))); + } fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hTPCdEdx"), leg.tpcInnerParam(), leg.tpcSignal()); fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hTPCNsigmaEl"), leg.tpcInnerParam(), leg.tpcNSigmaEl()); fRegistry.fill(HIST("V0Leg/") + HIST(mcphoton_types[mctype]) + HIST("hTPCNsigmaPi"), leg.tpcInnerParam(), leg.tpcNSigmaPi()); @@ -452,7 +454,7 @@ struct PCMQCMC { fRegistry.fill(HIST("V0/fromWD/hNgamma"), ng_wd); fRegistry.fill(HIST("V0/fromHS/hNgamma"), ng_hs); } // end of collision loop - } // end of process + } // end of process template void fillBinnedData(TBinnedData const& binned_data, const float weight = 1.f) @@ -516,7 +518,7 @@ struct PCMQCMC { fRegistry.fill(HIST("Generated/hPhotonPhivsRxy"), daughter.phi(), rxy_gen_e); } } // end of mctrack loop per collision - } // end of collision loop + } // end of collision loop } void processDummy(MyCollisions const&) {} From 106e81ed50e1115f4c8fc041832317523ee53de3 Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Sat, 7 Sep 2024 15:11:32 +0200 Subject: [PATCH 51/60] PWGHF: DpCorr - Add option for daughters removal (#7600) * Add option for daughters removal * Change flag definition --- .../TableProducer/correlatorDplusHadrons.cxx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index 9098a419895..166ebb7eab8 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -162,7 +162,8 @@ struct HfCorrelatorDplusHadrons { Configurable selectionFlagDplus{"selectionFlagDplus", 7, "Selection Flag for Dplus"}; // 7 corresponds to topo+PID cuts Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; - Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying D-meson efficiency weights"}; + Configurable applyEfficiency{"applyEfficiency", true, "Flag for applying D-meson efficiency weights"}; + Configurable removeDaughters{"removeDaughters", true, "Flag for removing D-meson daughters from correlations"}; 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"}; @@ -352,8 +353,10 @@ struct HfCorrelatorDplusHadrons { continue; } // Removing Dplus daughters by checking track indices - if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - continue; + if (removeDaughters) { + if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { + continue; + } } entryDplusHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), @@ -472,8 +475,10 @@ struct HfCorrelatorDplusHadrons { continue; } // Removing Dplus daughters by checking track indices - if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - continue; + if (removeDaughters) { + if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { + continue; + } } entryDplusHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), @@ -568,8 +573,10 @@ struct HfCorrelatorDplusHadrons { if (std::abs(particleAssoc.eta()) > etaTrackMax || particleAssoc.pt() < ptTrackMin || particleAssoc.pt() > ptTrackMax) { continue; } - if (particleAssoc.globalIndex() == prongsId[0] || particleAssoc.globalIndex() == prongsId[1] || particleAssoc.globalIndex() == prongsId[2]) { - continue; + if (removeDaughters) { + 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(particleAssoc.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; From 881e619a9be1089b88a54a41d730d6b1eedcaf99 Mon Sep 17 00:00:00 2001 From: jaimenorman Date: Sat, 7 Sep 2024 15:59:07 +0100 Subject: [PATCH 52/60] PWGJE: fix and plot z vertex selection (#7603) --- PWGJE/Tasks/jetHadronRecoil.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index 14733c99de6..bf1e96b0208 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -73,6 +73,7 @@ struct hJetAnalysis { HistogramRegistry registry{"registry", {{"hNtrig", "number of triggers;trigger type;entries", {HistType::kTH1F, {{2, 0, 2}}}}, + {"hZvtxSelected", "Z vertex position;Z_{vtx};entries", {HistType::kTH1F, {{80, -20, 20}}}}, {"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}}}}, @@ -429,6 +430,7 @@ struct hJetAnalysis { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillHistograms(jets, jetsWTA, tracks); } PROCESS_SWITCH(hJetAnalysis, processData, "process data", true); @@ -441,6 +443,7 @@ struct hJetAnalysis { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillHistograms(jets, jetsWTA, tracks); } PROCESS_SWITCH(hJetAnalysis, processMCD, "process MC detector level", false); @@ -453,6 +456,7 @@ struct hJetAnalysis { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + 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); @@ -462,9 +466,10 @@ struct hJetAnalysis { soa::Filtered> const& jetsWTA, JetParticles const& particles) { - if (collision.posZ() < vertexZCut) { // For some reason declaring a filter doesnt work + if (std::abs(collision.posZ()) > vertexZCut) { return; } + registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillMCPHistograms(jets, jetsWTA, particles); } PROCESS_SWITCH(hJetAnalysis, processMCP, "process MC particle level", false); @@ -474,9 +479,10 @@ struct hJetAnalysis { soa::Filtered> const& jetsWTA, JetParticles const& particles) { - if (collision.posZ() < vertexZCut) { + if (std::abs(collision.posZ()) > vertexZCut) { return; } + 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); @@ -493,6 +499,7 @@ struct hJetAnalysis { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + registry.fill(HIST("hZvtxSelected"), collision.posZ()); const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); for (const auto& mcdjet : mcdjets) { fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets); @@ -512,6 +519,7 @@ struct hJetAnalysis { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + registry.fill(HIST("hZvtxSelected"), collision.posZ()); const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); for (const auto& mcdjet : mcdjets) { fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets, mcdjet.eventWeight()); @@ -531,6 +539,7 @@ struct hJetAnalysis { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + registry.fill(HIST("hZvtxSelected"), collision.posZ()); const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); bool ishJetEvent = false; for (auto& track : tracks) { @@ -559,6 +568,7 @@ struct hJetAnalysis { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + registry.fill(HIST("hZvtxSelected"), collision.posZ()); const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); bool ishJetEvent = false; for (auto& track : tracks) { From 77756bce4a28932637c83343e50832e4fb2ed191 Mon Sep 17 00:00:00 2001 From: aimeric-landou <46970521+aimeric-landou@users.noreply.github.com> Date: Sat, 7 Sep 2024 17:02:08 +0200 Subject: [PATCH 53/60] PWGJE - jetfinderQA Random Cone process: configurable DeltaR to lead jet (#7585) * PWGJE - jetfinderQA Random Cone process: configurable DeltaR to lead jet * fix config name --- PWGJE/Tasks/jetfinderQA.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGJE/Tasks/jetfinderQA.cxx b/PWGJE/Tasks/jetfinderQA.cxx index f4c08e6dbb6..177076837c6 100644 --- a/PWGJE/Tasks/jetfinderQA.cxx +++ b/PWGJE/Tasks/jetfinderQA.cxx @@ -68,6 +68,7 @@ struct JetFinderQATask { Configurable leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"}; Configurable leadingConstituentPtMax{"leadingConstituentPtMax", 9999.0, "maximum pT selection on jet constituent"}; Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; + Configurable randomConeLeadJetDeltaR{"randomConeLeadJetDeltaR", -99.0, "min distance between leading jet axis and random cone (RC) axis; if negative, min distance is set to automatic value of R_leadJet+R_RC "}; Configurable checkMcCollisionIsMatched{"checkMcCollisionIsMatched", false, "0: count whole MCcollisions, 1: select MCcollisions which only have their correspond collisions"}; Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; Configurable trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"}; @@ -611,7 +612,7 @@ struct JetFinderQATask { float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta; bool jetWasInCone = false; - while (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR) { + while ((randomConeLeadJetDeltaR <= 0 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR)) || (randomConeLeadJetDeltaR > 0 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < randomConeLeadJetDeltaR))) { jetWasInCone = true; randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); From 5eece4f8713155e3cf3fe2e28b7f52ac43f79ab9 Mon Sep 17 00:00:00 2001 From: feisenhu <53603353+feisenhu@users.noreply.github.com> Date: Sat, 7 Sep 2024 17:35:32 +0200 Subject: [PATCH 54/60] [PWGEM] Add track propagation in TableMakerMC (#7604) --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index d8ac99db3af..09e53dd1a68 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -152,10 +152,8 @@ struct TableMakerMC { 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"}; @@ -165,6 +163,9 @@ struct TableMakerMC { 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"}; @@ -519,6 +520,9 @@ struct TableMakerMC { trackFilteringTag = uint64_t(0); trackTempFilterMap = uint8_t(0); VarManager::FillTrack(track); + if (fPropTrack && (track.collisionId() != collision.globalIndex())) { + VarManager::FillTrackCollision(track, collision); + } if (fDoDetailedQA) { fHistMan->FillHistClass("TrackBarrel_BeforeCuts", VarManager::fgValues); } From 5b7abba115e17d5c29de724f08dd9de521b8cd8f Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sat, 7 Sep 2024 22:50:53 +0200 Subject: [PATCH 55/60] PWGEM/Dilepton: update SP resolution (#7605) --- PWGEM/Dilepton/Core/Dilepton.h | 66 ++++++++++++++++++-------------- PWGEM/Dilepton/Tasks/eventQC.cxx | 2 +- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 1255519359b..cfe4099a736 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -248,7 +248,7 @@ struct Dilepton { float beamE2 = 0.f; // beam energy float beamP1 = 0.f; // beam momentum float beamP2 = 0.f; // beam momentum - TH1D* h1sp_resolution = nullptr; + TH2D* h2sp_resolution = nullptr; void init(InitContext& /*context*/) { @@ -428,9 +428,8 @@ struct Dilepton { if (cfgApplySPresolution) { auto list = ccdb->getForTimeStamp(spresoPath, collision.timestamp()); - h1sp_resolution = reinterpret_cast(list->FindObject(spresoHistName.value.data())); - // h1sp_resolution = ccdb->getForTimeStamp(spresoPath.value + "/" + spresoHistName.value, collision.timestamp()); - LOGF(info, "h1sp_resolution.GetBinContent(40) = %f", h1sp_resolution->GetBinContent(40)); + h2sp_resolution = reinterpret_cast(list->FindObject(spresoHistName.value.data())); + LOGF(info, "h2sp_resolution.GetBinContent(40, 1) = %f", h2sp_resolution->GetBinContent(40, 1)); } } @@ -442,6 +441,7 @@ struct Dilepton { emh_neg = 0x0; map_mixed_eventId_to_centrality.clear(); + map_mixed_eventId_to_occupancy.clear(); map_mixed_eventId_to_qvector.clear(); map_mixed_eventId_to_globalBC.clear(); @@ -451,7 +451,7 @@ struct Dilepton { if (eid_bdt) { delete eid_bdt; } - delete h1sp_resolution; + delete h2sp_resolution; } void addhistograms() @@ -689,7 +689,7 @@ struct Dilepton { { bool is_good = true; for (auto& qn : qvectors[nmod]) { - if (abs(qn[0]) > 10.f || abs(qn[1]) > 10.f) { + if (fabs(qn[0]) > 20.f || fabs(qn[1]) > 20.f) { is_good = false; break; } @@ -697,12 +697,28 @@ struct Dilepton { return is_good; } - float getSPresolution(const float centrality) + float getSPresolution(const float centrality, const int occupancy) { - if (h1sp_resolution == nullptr) { + if (h2sp_resolution == nullptr) { return 1.f; } else { - return h1sp_resolution->GetBinContent(h1sp_resolution->FindBin(centrality)); + int binId_cen = h2sp_resolution->GetXaxis()->FindBin(centrality); + int binId_occ = h2sp_resolution->GetYaxis()->FindBin(occupancy); + + if (centrality < h2sp_resolution->GetXaxis()->GetXmin()) { + binId_cen = 1; + } + if (h2sp_resolution->GetXaxis()->GetXmax() < centrality) { + binId_cen = h2sp_resolution->GetXaxis()->GetNbins(); + } + + if (occupancy < h2sp_resolution->GetYaxis()->GetXmin()) { + binId_occ = 1; + } + if (h2sp_resolution->GetYaxis()->GetXmax() < occupancy) { + binId_occ = h2sp_resolution->GetYaxis()->GetNbins(); + } + return h2sp_resolution->GetBinContent(binId_cen, binId_occ); } } @@ -854,9 +870,9 @@ struct Dilepton { }; if constexpr (ev_id == 0) { - // LOGF(info, "collision.centFT0C() = %f, getSPresolution = %f", collision.centFT0C(), getSPresolution(collision.centFT0C())); + // LOGF(info, "collision.centFT0C() = %f, collision.trackOccupancyInTimeRange() = %d, getSPresolution = %f", collision.centFT0C(), collision.trackOccupancyInTimeRange(), getSPresolution(collision.centFT0C(), collision.trackOccupancyInTimeRange())); - float sp = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v12.Phi())), static_cast(std::sin(nmod * v12.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(collision.centFT0C()); + float sp = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v12.Phi())), static_cast(std::sin(nmod * v12.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(collision.centFT0C(), collision.trackOccupancyInTimeRange()); 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/hPrfUQ"), v12.M(), v12.Pt(), pair_dca, sp, weight); @@ -1020,6 +1036,7 @@ struct Dilepton { TEMH* emh_neg = nullptr; std::map, std::vector>>> map_mixed_eventId_to_qvector; std::map, float> map_mixed_eventId_to_centrality; + std::map, int> map_mixed_eventId_to_occupancy; std::map, uint64_t> map_mixed_eventId_to_globalBC; std::vector> used_trackIds; @@ -1212,13 +1229,6 @@ struct Dilepton { // run mixed event loop for flow measurement. Don't divide mixed-event categories by event planes, if you do flow measurement. if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3)) { - // if (selected_posTracks_in_this_event.size() + selected_negTracks_in_this_event.size() <= 0) { - // continue; - // } - // fRegistry.fill(HIST("Pair/mix/ev1/hPrf_SP12_CentFT0C"), centrality, RecoDecay::dotProd(qvectors[nmod][cfgQvecEstimator], qvectors[nmod][subdet2])); // current collision - // fRegistry.fill(HIST("Pair/mix/ev1/hPrf_SP13_CentFT0C"), centrality, RecoDecay::dotProd(qvectors[nmod][cfgQvecEstimator], qvectors[nmod][subdet3])); // current collision - // fRegistry.fill(HIST("Pair/mix/ev1/hPrf_SP23_CentFT0C"), centrality, RecoDecay::dotProd(qvectors[nmod][subdet2], qvectors[nmod][subdet3])); // current collision - for (int epbin_tmp = 0; epbin_tmp < static_cast(ep_bin_edges.size()) - 1; epbin_tmp++) { std::tuple key_bin = std::make_tuple(zbin, centbin, epbin_tmp, occbin); auto collisionIds_in_mixing_pool = emh_pos->GetCollisionIdsFromEventPool(key_bin); // pos/neg does not matter. @@ -1232,6 +1242,7 @@ struct Dilepton { } auto centrality_mix = map_mixed_eventId_to_centrality[mix_dfId_collisionId]; + auto occupancy_mix = map_mixed_eventId_to_occupancy[mix_dfId_collisionId]; auto qvectors_mix = map_mixed_eventId_to_qvector[mix_dfId_collisionId]; auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); @@ -1239,35 +1250,31 @@ struct Dilepton { continue; } - // fRegistry.fill(HIST("Pair/mix/ev2/hPrf_SP12_CentFT0C"), centrality_mix, RecoDecay::dotProd(qvectors_mix[nmod][cfgQvecEstimator], qvectors_mix[nmod][subdet2])); // another collision - // fRegistry.fill(HIST("Pair/mix/ev2/hPrf_SP13_CentFT0C"), centrality_mix, RecoDecay::dotProd(qvectors_mix[nmod][cfgQvecEstimator], qvectors_mix[nmod][subdet3])); // another collision - // fRegistry.fill(HIST("Pair/mix/ev2/hPrf_SP23_CentFT0C"), centrality_mix, RecoDecay::dotProd(qvectors_mix[nmod][subdet2], qvectors_mix[nmod][subdet3])); // another collision - auto posTracks_from_event_pool = emh_pos->GetTracksPerCollision(mix_dfId_collisionId); auto negTracks_from_event_pool = emh_neg->GetTracksPerCollision(mix_dfId_collisionId); // LOGF(info, "Do event mixing: current event (%d, %d) | event pool (%d, %d), npos = %d , nneg = %d", ndf, collision.globalIndex(), mix_dfId, mix_collisionId, posTracks_from_event_pool.size(), negTracks_from_event_pool.size()); for (auto& pos : selected_posTracks_in_this_event) { // ULS mix for (auto& neg : negTracks_from_event_pool) { - fillMixedPairInfoForFlow(pos, neg, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); + fillMixedPairInfoForFlow(pos, neg, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix, collision.trackOccupancyInTimeRange(), occupancy_mix); } } for (auto& neg : selected_negTracks_in_this_event) { // ULS mix for (auto& pos : posTracks_from_event_pool) { - fillMixedPairInfoForFlow(neg, pos, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); + fillMixedPairInfoForFlow(neg, pos, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix, collision.trackOccupancyInTimeRange(), occupancy_mix); } } for (auto& pos1 : selected_posTracks_in_this_event) { // LS++ mix for (auto& pos2 : posTracks_from_event_pool) { - fillMixedPairInfoForFlow(pos1, pos2, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); + fillMixedPairInfoForFlow(pos1, pos2, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix, collision.trackOccupancyInTimeRange(), occupancy_mix); } } for (auto& neg1 : selected_negTracks_in_this_event) { // LS-- mix for (auto& neg2 : negTracks_from_event_pool) { - fillMixedPairInfoForFlow(neg1, neg2, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix); + fillMixedPairInfoForFlow(neg1, neg2, cut, qvectors, qvectors_mix, collision.centFT0C(), centrality_mix, collision.trackOccupancyInTimeRange(), occupancy_mix); } } } // end of loop over mixed event pool @@ -1280,6 +1287,7 @@ struct Dilepton { if (nmod > 0) { map_mixed_eventId_to_qvector[key_df_collision] = qvectors; map_mixed_eventId_to_centrality[key_df_collision] = collision.centFT0C(); + map_mixed_eventId_to_occupancy[key_df_collision] = collision.trackOccupancyInTimeRange(); } map_mixed_eventId_to_globalBC[key_df_collision] = collision.globalBC(); emh_pos->AddCollisionIdAtLast(key_bin, key_df_collision); @@ -1292,7 +1300,7 @@ struct Dilepton { } // end of DF template - bool fillMixedPairInfoForFlow(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TQvectors const& qvectors, TMixedQvectors const& qvectors_mix, const float centrality, const float centrality_mix) + bool fillMixedPairInfoForFlow(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TQvectors const& qvectors, TMixedQvectors const& qvectors_mix, const float centrality, const float centrality_mix, const int occupancy, const int occupancy_mix) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { auto v1ambIds = t1.ambiguousElectronsIds(); @@ -1333,8 +1341,8 @@ struct Dilepton { pair_dca = std::sqrt((dca_t1 * dca_t1 + dca_t2 * dca_t2) / 2.); } - float sp1 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v1.Phi())), static_cast(std::sin(nmod * v1.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(centrality); - float sp2 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v2.Phi())), static_cast(std::sin(nmod * v2.Phi()))}, qvectors_mix[nmod][cfgQvecEstimator]) / getSPresolution(centrality_mix); + float sp1 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v1.Phi())), static_cast(std::sin(nmod * v1.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(centrality, occupancy); + float sp2 = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v2.Phi())), static_cast(std::sin(nmod * v2.Phi()))}, qvectors_mix[nmod][cfgQvecEstimator]) / getSPresolution(centrality_mix, occupancy_mix); float cos_dphi1 = std::cos(nmod * (v1.Phi() - v12.Phi())); float cos_dphi2 = std::cos(nmod * (v2.Phi() - v12.Phi())); float cos_dphi12 = std::cos(nmod * (v1.Phi() - v2.Phi())); diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index 768077d3df6..c7570928c6e 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -464,7 +464,7 @@ struct eventQC { { bool is_good = true; for (auto& qvec : qvectors) { - if (fabs(qvec[0]) > 10.f || fabs(qvec[1]) > 10.f) { + if (fabs(qvec[0]) > 20.f || fabs(qvec[1]) > 20.f) { is_good = false; break; } From 17dc2b26551aafd76759b94a8038c7fe3ef577df Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sun, 8 Sep 2024 01:16:38 +0200 Subject: [PATCH 56/60] PWGEM/Dilepton: include TOFif in TPChadrej (#7606) --- PWGEM/Dilepton/Core/DielectronCut.h | 11 ++++++----- PWGEM/Dilepton/Core/Dilepton.h | 5 +---- PWGEM/Dilepton/Core/DileptonMC.h | 13 +++++-------- PWGEM/Dilepton/Core/PhotonHBT.h | 5 +---- PWGEM/Dilepton/Core/SingleTrackQC.h | 5 +---- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 5 +---- 6 files changed, 15 insertions(+), 29 deletions(-) diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index ff7155b778a..2eae79783d9 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -200,10 +200,10 @@ class DielectronCut : public TNamed return false; } - // TOF beta cut - if (track.hasTOF() && (track.beta() < mMinTOFbeta || mMaxTOFbeta < track.beta())) { - return false; - } + // // TOF beta cut + // if (track.hasTOF() && (track.beta() < mMinTOFbeta || mMaxTOFbeta < track.beta())) { + // return false; + // } // PID cuts if constexpr (isML) { @@ -284,7 +284,8 @@ class DielectronCut : public TNamed bool is_pi_excluded_TPC = track.tpcNSigmaPi() < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi(); bool is_ka_excluded_TPC = track.tpcNSigmaKa() < mMinTPCNsigmaKa || mMaxTPCNsigmaKa < track.tpcNSigmaKa(); bool is_pr_excluded_TPC = track.tpcNSigmaPr() < mMinTPCNsigmaPr || mMaxTPCNsigmaPr < track.tpcNSigmaPr(); - return is_el_included_TPC && is_mu_excluded_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC; + bool is_el_included_TOF = track.hasTOF() ? (mMinTOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < mMaxTOFNsigmaEl) : true; + return is_el_included_TPC && is_mu_excluded_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC && is_el_included_TOF; } template diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index cfe4099a736..9bd0c72b637 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -167,8 +167,6 @@ struct Dilepton { Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; 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_min_TOFbeta{"cfg_min_TOFbeta", 0.985, "min TOF beta for single track"}; //|beta - 1 | < 0.015 corresponds to 3 sigma in pp - Configurable cfg_max_TOFbeta{"cfg_max_TOFbeta", 1.015, "max TOF beta for single track"}; //|beta - 1 | < 0.015 corresponds to 3 sigma in pp Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -632,7 +630,6 @@ struct Dilepton { fDielectronCut.SetMaxDcaZ(dielectroncuts.cfg_max_dcaz); // for eID - fDielectronCut.SetTOFbetaRange(dielectroncuts.cfg_min_TOFbeta, dielectroncuts.cfg_max_TOFbeta); 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); @@ -1021,7 +1018,7 @@ struct Dilepton { SliceCache cache; Preslice perCollision_electron = aod::emprimaryelectron::emeventId; 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 && 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) && ((dielectroncuts.cfg_min_TOFbeta < o2::aod::pidtofbeta::beta && o2::aod::pidtofbeta::beta < dielectroncuts.cfg_max_TOFbeta) || o2::aod::pidtofbeta::beta < 0.f); + 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); Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 8367142e9f9..cb42475a76c 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -150,8 +150,6 @@ struct DileptonMC { Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; 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_min_TOFbeta{"cfg_min_TOFbeta", 0.985, "min TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp - Configurable cfg_max_TOFbeta{"cfg_max_TOFbeta", 1.015, "max TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -502,7 +500,6 @@ struct DileptonMC { fDielectronCut.SetMaxDcaZ(dielectroncuts.cfg_max_dcaz); // for eID - fDielectronCut.SetTOFbetaRange(dielectroncuts.cfg_min_TOFbeta, dielectroncuts.cfg_max_TOFbeta); 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); @@ -786,7 +783,7 @@ struct DileptonMC { break; } } // end of primary/secondary selection - } // end of primary selection for same mother + } // end of primary selection for same mother } else if (hfee_type > -1) { if ((t1mc.isPhysicalPrimary() || t1mc.producedByGenerator()) && (t2mc.isPhysicalPrimary() || t2mc.producedByGenerator())) { auto mp1 = mcparticles.iteratorAt(t1mc.mothersIds()[0]); @@ -880,7 +877,7 @@ struct DileptonMC { SliceCache cache; Preslice perCollision_electron = aod::emprimaryelectron::emeventId; 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 && 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) && ((dielectroncuts.cfg_min_TOFbeta < o2::aod::pidtofbeta::beta && o2::aod::pidtofbeta::beta < dielectroncuts.cfg_max_TOFbeta) || o2::aod::pidtofbeta::beta < 0.f); + 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); Preslice perCollision_muon = aod::emprimarymuon::emeventId; @@ -1181,7 +1178,7 @@ struct DileptonMC { break; } } // end of HF evaluation - } // end of true ULS pair loop + } // end of true ULS pair loop for (auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LOGF(info, "pdg1 = %d, pdg2 = %d", t1.pdgCode(), t2.pdgCode()); @@ -1420,7 +1417,7 @@ struct DileptonMC { } } } // end of true LS++ pair loop - } // end of collision loop + } // end of collision loop // for oemga, phi efficiency for (auto& collision : collisions) { @@ -1463,7 +1460,7 @@ struct DileptonMC { } } // end of mctracks per mccollision - } // end of collision loop + } // end of collision loop } template diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index 5d08c0be583..839a96fdfc1 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -186,8 +186,6 @@ struct PhotonHBT { Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; 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_min_TOFbeta{"cfg_min_TOFbeta", 0.985, "min TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp - Configurable cfg_max_TOFbeta{"cfg_max_TOFbeta", 1.015, "max TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp 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_max_p_its_cluster_size{"cfg_max_p_its_cluster_size", 0.2, "max p to apply ITS cluster size cut"}; @@ -527,7 +525,6 @@ struct PhotonHBT { fDielectronCut.SetMaxDcaZ(dielectroncuts.cfg_max_dcaz); // for eID - fDielectronCut.SetTOFbetaRange(dielectroncuts.cfg_min_TOFbeta, dielectroncuts.cfg_max_TOFbeta); 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); @@ -1190,7 +1187,7 @@ struct PhotonHBT { } Filter trackFilter = 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 && 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 = (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) && ((dielectroncuts.cfg_min_TOFbeta < o2::aod::pidtofbeta::beta && o2::aod::pidtofbeta::beta < dielectroncuts.cfg_max_TOFbeta) || o2::aod::pidtofbeta::beta < 0.f); + Filter pidFilter = (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 = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0); diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 85c2212a004..47079887fff 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -115,8 +115,6 @@ struct SingleTrackQC { Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "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_TOFbeta{"cfg_min_TOFbeta", 0.985, "min TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp - Configurable cfg_max_TOFbeta{"cfg_max_TOFbeta", 1.015, "max TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -319,7 +317,6 @@ struct SingleTrackQC { fDielectronCut.RequireITSib1st(dielectroncuts.cfg_require_itsib_1st); // for eID - fDielectronCut.SetTOFbetaRange(dielectroncuts.cfg_min_TOFbeta, dielectroncuts.cfg_max_TOFbeta); 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); @@ -614,7 +611,7 @@ struct SingleTrackQC { SliceCache cache; Preslice perCollision_electron = aod::emprimaryelectron::emeventId; 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 && 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) && ((dielectroncuts.cfg_min_TOFbeta < o2::aod::pidtofbeta::beta && o2::aod::pidtofbeta::beta < dielectroncuts.cfg_max_TOFbeta) || o2::aod::pidtofbeta::beta < 0.f); + 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); Preslice perCollision_muon = aod::emprimarymuon::emeventId; diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 2e126a80cfa..cd600cf7aed 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -118,8 +118,6 @@ struct SingleTrackQCMC { Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "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_TOFbeta{"cfg_min_TOFbeta", 0.985, "min TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp - Configurable cfg_max_TOFbeta{"cfg_max_TOFbeta", 1.015, "max TOF beta for single track"}; //|beta - 1| < 0.015 corresponds to 3 sigma in pp Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -365,7 +363,6 @@ struct SingleTrackQCMC { fDielectronCut.RequireITSib1st(dielectroncuts.cfg_require_itsib_1st); // for eID - fDielectronCut.SetTOFbetaRange(dielectroncuts.cfg_min_TOFbeta, dielectroncuts.cfg_max_TOFbeta); 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); @@ -873,7 +870,7 @@ struct SingleTrackQCMC { SliceCache cache; Preslice perCollision_electron = aod::emprimaryelectron::emeventId; 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 && 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) && ((dielectroncuts.cfg_min_TOFbeta < o2::aod::pidtofbeta::beta && o2::aod::pidtofbeta::beta < dielectroncuts.cfg_max_TOFbeta) || o2::aod::pidtofbeta::beta < 0.f); + 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); Preslice perCollision_muon = aod::emprimarymuon::emeventId; From 60a7eee5aea613bb84c1736ebef79005ca01a091 Mon Sep 17 00:00:00 2001 From: Anisa Khatun Date: Sun, 8 Sep 2024 09:55:27 +0200 Subject: [PATCH 57/60] PWGUD: Bug fix and reduced output size for event by event analysis (#7449) * bug fix and reduced outputsize * bug fix and reduced outputsize --------- Co-authored-by: akhatun --- PWGUD/Tasks/eventByevent.cxx | 217 ++++++++++++-------------------- PWGUD/Tasks/upcPionAnalysis.cxx | 22 ++-- 2 files changed, 90 insertions(+), 149 deletions(-) diff --git a/PWGUD/Tasks/eventByevent.cxx b/PWGUD/Tasks/eventByevent.cxx index 0ed0037101a..3df594af546 100644 --- a/PWGUD/Tasks/eventByevent.cxx +++ b/PWGUD/Tasks/eventByevent.cxx @@ -36,13 +36,13 @@ namespace o2::aod { namespace tree { -DECLARE_SOA_COLUMN(GAPSIDE, gapside, int); -DECLARE_SOA_COLUMN(FT0AAMP, ft0Aamp, float); // namespace udzdc -DECLARE_SOA_COLUMN(FT0CAMP, ft0Camp, float); -DECLARE_SOA_COLUMN(FDDAAMP, fddAamp, float); -DECLARE_SOA_COLUMN(FDDCAMP, fddCamp, float); -DECLARE_SOA_COLUMN(FV0AAMP, fv0Aamp, float); -// ZDC tables +// DECLARE_SOA_COLUMN(GAPSIDE, gapside, int); +// DECLARE_SOA_COLUMN(FT0AAMP, ft0Aamp, float); // namespace udzdc +// DECLARE_SOA_COLUMN(FT0CAMP, ft0Camp, float); +// DECLARE_SOA_COLUMN(FDDAAMP, fddAamp, float); +// DECLARE_SOA_COLUMN(FDDCAMP, fddCamp, float); +// DECLARE_SOA_COLUMN(FV0AAMP, fv0Aamp, float); +// ZDC tables DECLARE_SOA_COLUMN(ZAENERGY, zaenergy, float); // namespace udzdc DECLARE_SOA_COLUMN(ZCENERGY, zcenergy, float); // track tables @@ -70,19 +70,19 @@ DECLARE_SOA_COLUMN(PTS, Pts, std::vector); DECLARE_SOA_COLUMN(ETAS, etas, std::vector); DECLARE_SOA_COLUMN(PHIS, Phis, std::vector); DECLARE_SOA_COLUMN(SIGNS, Signs, std::vector); -DECLARE_SOA_COLUMN(RAWTRACKS, rawtracks, int); -DECLARE_SOA_COLUMN(PTRACKS, ptracks, int); +// DECLARE_SOA_COLUMN(RAWTRACKS, rawtracks, int); +// DECLARE_SOA_COLUMN(PTRACKS, ptracks, int); // DECLARE_SOA_COLUMN(NTPCCLS, ntpccls,int); } // namespace tree DECLARE_SOA_TABLE(TREE, "AOD", "Tree", //! ZDC information - tree::GAPSIDE, - tree::FT0AAMP, - tree::FT0CAMP, - tree::FDDAAMP, - tree::FDDCAMP, - tree::FV0AAMP, + // tree::GAPSIDE, + // tree::FT0AAMP, + // tree::FT0CAMP, + // tree::FDDAAMP, + // tree::FDDCAMP, + // tree::FV0AAMP, tree::ZAENERGY, tree::ZCENERGY, tree::PT, @@ -107,9 +107,10 @@ DECLARE_SOA_TABLE(TREE, "AOD", "Tree", //! ZDC information tree::PTS, tree::ETAS, tree::PHIS, - tree::SIGNS, - tree::RAWTRACKS, - tree::PTRACKS); + tree::SIGNS + // tree::RAWTRACKS, + // tree::PTRACKS +); } // namespace o2::aod @@ -177,7 +178,7 @@ struct EventByEvent { } using udtracks = soa::Join; - using udtracksfull = soa::Join; + using udtracksfull = soa::Join; using UDCollisionsFull = soa::Join; //__________________________________________________________________________ // Main process @@ -218,141 +219,77 @@ struct EventByEvent { TLorentzVector p; - /* float pipid1; - float pipid2; - float pipid3; - float pipid4; - float kpid1; - float kpid2; - float kpid3; - float kpid4; - float elpid1; - float elpid2; - float elpid3; - float elpid4;*/ - - // registry.fill(HIST("hTracks"), tracks.size()); - - if (collision.numContrib() > collcontrib_cut) - return; + if (gapSide == gap_Side) { - registry.fill(HIST("hSelectionCounter"), 4); - if ((collision.posZ() < -(Zvtx_cut)) || (collision.posZ() > Zvtx_cut)) - return; - registry.fill(HIST("hSelectionCounter"), 5); + // registry.fill(HIST("hTracks"), tracks.size()); - for (auto t : tracks) { - if (!t.isPVContributor()) { - continue; - } + if (collision.numContrib() > collcontrib_cut) + return; - int NFindable = t.tpcNClsFindable(); - int NMinusFound = t.tpcNClsFindableMinusFound(); - int NCluster = NFindable - NMinusFound; + registry.fill(HIST("hSelectionCounter"), 4); + if ((collision.posZ() < -(Zvtx_cut)) || (collision.posZ() > Zvtx_cut)) + return; + registry.fill(HIST("hSelectionCounter"), 5); - if (NCluster < TPC_cluster) { - continue; - } + for (auto t : tracks) { - double dEdx = t.tpcSignal(); + if (!trackselector(t, parameters)) + continue; - registry.fill(HIST("hdEdx"), t.tpcInnerParam() / t.sign(), dEdx); - TLorentzVector a; - a.SetXYZM(t.px(), t.py(), t.pz(), o2::constants::physics::MassPionCharged); - allTracks.push_back(a); - auto nSigmaPi = t.tpcNSigmaPi(); + double dEdx = t.tpcSignal(); - if (fabs(nSigmaPi) < PID_cut) { - onlyPionTracks.push_back(a); - onlyPionSigma.push_back(nSigmaPi); - rawPionTracks.push_back(t); - registry.fill(HIST("hdEdxPion"), t.tpcInnerParam() / t.sign(), dEdx); + registry.fill(HIST("hdEdx"), t.tpcInnerParam() / t.sign(), dEdx); + TLorentzVector a; + a.SetXYZM(t.px(), t.py(), t.pz(), o2::constants::physics::MassPionCharged); + allTracks.push_back(a); + auto nSigmaPi = t.tpcNSigmaPi(); + + if (fabs(nSigmaPi) < PID_cut) { + onlyPionTracks.push_back(a); + onlyPionSigma.push_back(nSigmaPi); + rawPionTracks.push_back(t); + registry.fill(HIST("hdEdxPion"), t.tpcInnerParam() / t.sign(), dEdx); + } } - } - registry.fill(HIST("hTracksPions"), onlyPionTracks.size()); + registry.fill(HIST("hTracksPions"), onlyPionTracks.size()); - //_____________________________________ - if (collision.numContrib() >= 2) { - // Four pions analysis - registry.fill(HIST("hSelectionCounter"), 6); - if ((rawPionTracks.size() >= 2) && (allTracks.size() >= 2)) { + //_____________________________________ + if (collision.numContrib() >= 2) { + // Four pions analysis + registry.fill(HIST("hSelectionCounter"), 6); + if ((rawPionTracks.size() >= 2) && (allTracks.size() >= 2)) { - for (auto pion : onlyPionTracks) { - p += pion; - } + for (auto pion : onlyPionTracks) { + p += pion; + } - registry.fill(HIST("h4TracksPions"), onlyPionTracks.size()); - registry.fill(HIST("hSelectionCounter"), 7); - - for (auto rtrk : rawPionTracks) { - - TLorentzVector itrk; - itrk.SetXYZM(rtrk.px(), rtrk.py(), rtrk.pz(), o2::constants::physics::MassPionCharged); - trackpt.push_back(itrk.Pt()); - tracketa.push_back(itrk.Eta()); - trackphi.push_back(itrk.Phi()); - tracksign.push_back(rtrk.sign()); - pitpcpid.push_back(rtrk.tpcNSigmaPi()); - ktpcpid.push_back(rtrk.tpcNSigmaKa()); - eltpcpid.push_back(rtrk.tpcNSigmaEl()); - prtpcpid.push_back(rtrk.tpcNSigmaPr()); - } + registry.fill(HIST("h4TracksPions"), onlyPionTracks.size()); + registry.fill(HIST("hSelectionCounter"), 7); + + for (auto rtrk : rawPionTracks) { + + TLorentzVector itrk; + itrk.SetXYZM(rtrk.px(), rtrk.py(), rtrk.pz(), o2::constants::physics::MassPionCharged); + trackpt.push_back(itrk.Pt()); + tracketa.push_back(itrk.Eta()); + trackphi.push_back(itrk.Phi()); + tracksign.push_back(rtrk.sign()); + pitpcpid.push_back(rtrk.tpcNSigmaPi()); + ktpcpid.push_back(rtrk.tpcNSigmaKa()); + eltpcpid.push_back(rtrk.tpcNSigmaEl()); + prtpcpid.push_back(rtrk.tpcNSigmaPr()); + } - /* trackpt.push_back(onlyPionTracks[0].Pt()); - trackpt.push_back(onlyPionTracks[1].Pt()); - trackpt.push_back(onlyPionTracks[2].Pt()); - trackpt.push_back(onlyPionTracks[3].Pt()); - - tracketa.push_back(onlyPionTracks[0].Eta()); - tracketa.push_back(onlyPionTracks[1].Eta()); - tracketa.push_back(onlyPionTracks[2].Eta()); - tracketa.push_back(onlyPionTracks[3].Eta()); - - trackphi.push_back(onlyPionTracks[0].Phi()); - trackphi.push_back(onlyPionTracks[1].Phi()); - trackphi.push_back(onlyPionTracks[2].Phi()); - trackphi.push_back(onlyPionTracks[3].Phi()); - - tracksign.push_back(rawPionTracks[0].sign()); - tracksign.push_back(rawPionTracks[1].sign()); - tracksign.push_back(rawPionTracks[2].sign()); - tracksign.push_back(rawPionTracks[3].sign()); - - pipid1 =rawPionTracks[0].tpcNSigmaPi(); - pipid2 =rawPionTracks[1].tpcNSigmaPi(); - pipid3 =rawPionTracks[2].tpcNSigmaPi(); - pipid4 =rawPionTracks[3].tpcNSigmaPi(); - - kpid1 = rawPionTracks[0].tpcNSigmaKa(); - kpid2 = rawPionTracks[1].tpcNSigmaKa(); - kpid3 = rawPionTracks[2].tpcNSigmaKa(); - kpid4 = rawPionTracks[3].tpcNSigmaKa(); - - elpid1 =rawPionTracks[0].tpcNSigmaEl(); - elpid2 =rawPionTracks[1].tpcNSigmaEl(); - elpid3 =rawPionTracks[2].tpcNSigmaEl(); - elpid4 =rawPionTracks[3].tpcNSigmaEl();*/ - - int sign = 0; - TLorentzVector piplus, piminus; - for (auto rawPion : rawPionTracks) { - sign += rawPion.sign(); - if (rawPion.sign() > 0) { - piplus = onlyPionTracks[0]; - piplus = onlyPionTracks[1]; - piplus = onlyPionTracks[2]; - piplus = onlyPionTracks[3]; - } else if (rawPion.sign() < 0) { - piminus = onlyPionTracks[0]; - piminus = onlyPionTracks[1]; - piminus = onlyPionTracks[2]; - piminus = onlyPionTracks[3]; + int sign = 0; + TLorentzVector piplus, piminus; + for (auto rawPion : rawPionTracks) { + sign += rawPion.sign(); } - } - registry.fill(HIST("hTracks"), collision.numContrib()); - // tree(gapSide,collision.totalFT0AmplitudeA(),collision.totalFT0AmplitudeC(),collision.totalFDDAmplitudeA(),collision.totalFDDAmplitudeC(),collision.totalFV0AmplitudeA(), collision.energyCommonZNA(), collision.energyCommonZNC(), p.Pt(),p.Y(),p.Phi(),p.M(),sign,collision.numContrib(),pipid1,pipid2,pipid3,pipid4,kpid1,kpid2,kpid3,kpid4,elpid1,elpid2,elpid3,elpid4,trackpt,tracketa,trackphi,tracksign); - tree(gapSide, collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), collision.totalFV0AmplitudeA(), collision.energyCommonZNA(), collision.energyCommonZNC(), p.Pt(), p.Y(), p.Phi(), p.M(), sign, collision.numContrib(), pitpcpid, ktpcpid, eltpcpid, prtpcpid, trackpt, tracketa, trackphi, tracksign, allTracks.size(), rawPionTracks.size()); + registry.fill(HIST("hTracks"), collision.numContrib()); + + tree(collision.energyCommonZNA(), collision.energyCommonZNC(), p.Pt(), p.Y(), p.Phi(), p.M(), sign, collision.numContrib(), pitpcpid, ktpcpid, eltpcpid, prtpcpid, trackpt, tracketa, trackphi, tracksign); + } } } } diff --git a/PWGUD/Tasks/upcPionAnalysis.cxx b/PWGUD/Tasks/upcPionAnalysis.cxx index bd7157dc702..8cab0acb000 100644 --- a/PWGUD/Tasks/upcPionAnalysis.cxx +++ b/PWGUD/Tasks/upcPionAnalysis.cxx @@ -67,7 +67,7 @@ struct UPCPionAnalysis { // defining histograms using histogram registry HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; - //_____________________________________________________________________________ + //_____________________________________________________________________________________________ Double_t CosThetaHelicityFrame(TLorentzVector pionPositive, TLorentzVector pionNegative, TLorentzVector possibleRhoZero) @@ -405,7 +405,7 @@ struct UPCPionAnalysis { registry.add("hCostheta6Pion", "Costheta;#it{Cos#Theta};", kTH1F, {{300, -1.5, 1.5}}); registry.add("hCostheta8Pion", "Costheta;#it{Cos#Theta};", kTH1F, {{300, -1.5, 1.5}}); - // using Angular Correlation method + // Using Angular Correlation method registry.add("TwoPion/Coherent/AccoplAngle", "AccoplAngle", kTH1F, {{250, -0.2, 0.2}}); registry.add("TwoPion/Coherent/CosTheta", "CosTheta", kTH1F, {{300, -1.5, 1.5}}); @@ -427,7 +427,7 @@ struct UPCPionAnalysis { } using udtracks = soa::Join; - using udtracksfull = soa::Join; + using udtracksfull = soa::Join; using UDCollisionsFull = soa::Join; //__________________________________________________________________________ // Main process @@ -476,17 +476,21 @@ struct UPCPionAnalysis { registry.fill(HIST("hSelectionCounter"), 5); for (auto t : tracks) { - if (!t.isPVContributor()) { + + /*if (!t.isPVContributor()) { + continue; + }*/ + + if (!trackselector(t, parameters)) continue; - } int NFindable = t.tpcNClsFindable(); int NMinusFound = t.tpcNClsFindableMinusFound(); int NCluster = NFindable - NMinusFound; - if (NCluster < TPC_cluster) { - continue; - } + /*if (NCluster < TPC_cluster) { + continue; + }*/ double dEdx = t.tpcSignal(); @@ -586,7 +590,7 @@ struct UPCPionAnalysis { } } } - //_____________________________________ + //_____________________________________________________________________________________________________ // Six pions analysis if (collision.numContrib() == 6) { if ((rawPionTracks.size() == 6) && (onlyPionTracks.size() == 6)) { From 933154ddb1fafb300675f8747163e26bdd9b504c Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Sun, 8 Sep 2024 10:28:03 +0200 Subject: [PATCH 58/60] PWGHF: Update p-K0S finding in trackIndexSkimCreator (#7599) * PWGHF: Update p-K0S finding in trackIndexSkimCreator * Build the V0 track only if needed * Please consider the following formatting changes --------- Co-authored-by: ALICE Action Bot --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 91 ++++++++----------- 1 file changed, 37 insertions(+), 54 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 2377b72633a..fe77bb275d9 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -2971,24 +2971,15 @@ struct HfTrackIndexSkimCreatorCascades { Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations if chi2/chi2old > this"}; Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; Configurable useWeightedFinalPCA{"useWeightedFinalPCA", true, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; - // quality cut - Configurable doCutQuality{"doCutQuality", true, "apply quality cuts"}; // track cuts for V0 daughters - Configurable tpcRefitV0Daugh{"tpcRefitV0Daugh", true, "request TPC refit V0 daughters"}; - Configurable nCrossedRowsMinV0Daugh{"nCrossedRowsMinV0Daugh", 50, "min crossed rows V0 daughters"}; Configurable etaMinV0Daugh{"etaMinV0Daugh", -99999., "min. pseudorapidity V0 daughters"}; Configurable etaMaxV0Daugh{"etaMaxV0Daugh", 1.1, "max. pseudorapidity V0 daughters"}; Configurable ptMinV0Daugh{"ptMinV0Daugh", 0.05, "min. pT V0 daughters"}; // v0 cuts - Configurable cpaV0Min{"cpaV0Min", .995, "min. cos PA V0"}; // as in the task that create the V0s - Configurable dcaXYNegToPvMin{"dcaXYNegToPvMin", .1, "min. DCA_XY Neg To PV"}; // check: in HF Run 2, it was 0 at filtering - Configurable dcaXYPosToPvMin{"dcaXYPosToPvMin", .1, "min. DCA_XY Pos To PV"}; // check: in HF Run 2, it was 0 at filtering + Configurable cpaV0Min{"cpaV0Min", 0.95, "min. cos PA V0"}; // as in the task that create the V0s Configurable cutInvMassV0{"cutInvMassV0", 0.05, "V0 candidate invariant mass difference wrt PDG"}; // cascade cuts Configurable ptCascCandMin{"ptCascCandMin", -1., "min. pT of the cascade candidate"}; // PbPb 2018: use 1 - Configurable massPrK0sMin{"massPrK0sMin", 0.f, "Invariant mass lower limit for p K0S decay channel"}; - Configurable massPrK0sMax{"massPrK0sMax", 1000.f, "Invariant mass upper limit for p K0S decay channel"}; - Configurable cutInvMassCascLc{"cutInvMassCascLc", 1., "Lc candidate invariant mass difference wrt PDG"}; // for PbPb 2018: use 0.2 // Configurable cutCascDCADaughters{"cutCascDCADaughters", .1, "DCA between V0 and bachelor in cascade"}; // proton PID @@ -3006,7 +2997,8 @@ struct HfTrackIndexSkimCreatorCascades { Service ccdb; o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - int runNumber; + o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + int runNumber{0}; double massP{0.}; double massK0s{0.}; @@ -3052,7 +3044,6 @@ struct HfTrackIndexSkimCreatorCascades { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(config.ccdbPathLut)); - runNumber = 0; if (config.fillHistograms) { registry.add("hVtx2ProngX", "2-prong candidates;#it{x}_{sec. vtx.} (cm);entries", {HistType::kTH1D, {{1000, -2., 2.}}}); @@ -3069,21 +3060,23 @@ struct HfTrackIndexSkimCreatorCascades { PROCESS_SWITCH(HfTrackIndexSkimCreatorCascades, processNoCascades, "Do not skim HF -> V0 cascades", true); void processCascades(SelectedCollisions const& collisions, - aod::V0Datas const& v0s, + soa::Join const& v0s, FilteredTrackAssocSel const& trackIndices, aod::TracksWCovDcaExtra const&, aod::BCsWithTimestamps const&) { // set the magnetic field from CCDB for (const auto& collision : collisions) { + auto bc = collision.bc_as(); + initCCDB(bc, runNumber, ccdb, config.isRun2 ? config.ccdbPathGrp : config.ccdbPathGrpMag, lut, config.isRun2); if (config.useDCAFitter) { - auto bc = collision.bc_as(); - initCCDB(bc, runNumber, ccdb, config.isRun2 ? config.ccdbPathGrp : config.ccdbPathGrpMag, lut, config.isRun2); df2.setBz(o2::base::Propagator::Instance()->getNominalBz()); + df2.setMatCorrType(matCorr); } const auto thisCollId = collision.globalIndex(); auto groupedBachTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); + auto groupedV0s = v0s.sliceBy(v0sPerCollision, thisCollId); // fist we loop over the bachelor candidate for (const auto& bachIdx : groupedBachTrackIndices) { @@ -3097,40 +3090,31 @@ struct HfTrackIndexSkimCreatorCascades { getPxPyPz(trackBach, pVecBach); } - auto groupedV0s = v0s.sliceBy(v0sPerCollision, thisCollId); // now we loop over the V0s for (const auto& v0 : groupedV0s) { // selections on the V0 daughters - const auto& trackV0DaughPos = v0.posTrack_as(); - const auto& trackV0DaughNeg = v0.negTrack_as(); + const auto& trackV0DaughPos = v0.posTrack_as(); // only used for indices and track cuts (TPC clusters, TPC refit) + const auto& trackV0DaughNeg = v0.negTrack_as(); // only used for indices and track cuts (TPC clusters, TPC refit) // check not to take the same track twice (as bachelor and V0 daughter) if (trackV0DaughPos.globalIndex() == bach.globalIndex() || trackV0DaughNeg.globalIndex() == bach.globalIndex()) { continue; } - if (config.tpcRefitV0Daugh) { - if (!(trackV0DaughPos.trackType() & o2::aod::track::TPCrefit) || - !(trackV0DaughNeg.trackType() & o2::aod::track::TPCrefit)) { - continue; - } - } - if (trackV0DaughPos.tpcNClsCrossedRows() < config.nCrossedRowsMinV0Daugh || - trackV0DaughNeg.tpcNClsCrossedRows() < config.nCrossedRowsMinV0Daugh) { - continue; - } - // - // if (trackV0DaughPos.dcaXY() < dcaXYPosToPvMin || // to the filters? - // trackV0DaughNeg.dcaXY() < dcaXYNegToPvMin) { - // continue; - // } - // - if (trackV0DaughPos.pt() < config.ptMinV0Daugh || // to the filters? I can't for now, it is not in the tables - trackV0DaughNeg.pt() < config.ptMinV0Daugh) { + std::array pVecPos = {v0.pxpos(), v0.pypos(), v0.pzpos()}; + std::array pVecNeg = {v0.pxneg(), v0.pyneg(), v0.pzneg()}; + + float ptPos = RecoDecay::pt(pVecPos); + float ptNeg = RecoDecay::pt(pVecNeg); + if (ptPos < config.ptMinV0Daugh || // to the filters? I can't for now, it is not in the tables + ptNeg < config.ptMinV0Daugh) { continue; } - if ((trackV0DaughPos.eta() > config.etaMaxV0Daugh || trackV0DaughPos.eta() < config.etaMinV0Daugh) || // to the filters? I can't for now, it is not in the tables - (trackV0DaughNeg.eta() > config.etaMaxV0Daugh || trackV0DaughNeg.eta() < config.etaMinV0Daugh)) { + + float etaPos = RecoDecay::eta(pVecPos); + float etaNeg = RecoDecay::eta(pVecNeg); + if ((etaPos > config.etaMaxV0Daugh || etaPos < config.etaMinV0Daugh) || // to the filters? I can't for now, it is not in the tables + (etaNeg > config.etaMaxV0Daugh || etaNeg < config.etaMinV0Daugh)) { continue; } @@ -3144,27 +3128,30 @@ struct HfTrackIndexSkimCreatorCascades { continue; } - const std::array momentumV0 = {v0.px(), v0.py(), v0.pz()}; + std::array pVecV0 = {v0.px(), v0.py(), v0.pz()}; // invariant-mass cut: we do it here, before updating the momenta of bach and V0 during the fitting to save CPU // TODO: but one should better check that the value here and after the fitter do not change significantly!!! - double mass2K0sP = RecoDecay::m(std::array{bach.pVector(), momentumV0}, std::array{massP, massK0s}); + double mass2K0sP = RecoDecay::m(std::array{pVecBach, pVecV0}, std::array{massP, massK0s}); if ((config.cutInvMassCascLc >= 0.) && (std::abs(mass2K0sP - massLc) > config.cutInvMassCascLc)) { continue; } - auto trackParCovV0DaughPos = getTrackParCov(trackV0DaughPos); - trackParCovV0DaughPos.propagateTo(v0.posX(), o2::base::Propagator::Instance()->getNominalBz()); // propagate the track to the X closest to the V0 vertex - auto trackParCovV0DaughNeg = getTrackParCov(trackV0DaughNeg); - trackParCovV0DaughNeg.propagateTo(v0.negX(), o2::base::Propagator::Instance()->getNominalBz()); // propagate the track to the X closest to the V0 vertex - std::array pVecV0 = {v0.px(), v0.py(), v0.pz()}; - - const std::array vertexV0 = {v0.x(), v0.y(), v0.z()}; - // we build the neutral track to then build the cascade - auto trackV0 = o2::dataformats::V0(vertexV0, momentumV0, {0, 0, 0, 0, 0, 0}, trackParCovV0DaughPos, trackParCovV0DaughNeg); // build the V0 track - // now we find the DCA between the V0 and the bachelor, for the cascade if (config.useDCAFitter) { + + const std::array vertexV0 = {v0.x(), v0.y(), v0.z()}; + // we build the neutral track to then build the cascade + std::array covV = {0.}; + constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component + for (int i = 0; i < 6; i++) { + covV[MomInd[i]] = v0.momentumCovMat()[i]; + covV[i] = v0.positionCovMat()[i]; + } + auto trackV0 = o2::track::TrackParCov(vertexV0, pVecV0, covV, 0, true); + trackV0.setAbsCharge(0); + trackV0.setPID(o2::track::PID::K0); + int nCand2 = 0; try { nCand2 = df2.process(trackV0, trackBach); @@ -3189,10 +3176,6 @@ struct HfTrackIndexSkimCreatorCascades { // invariant mass // re-calculate invariant masses with updated momenta, to fill the histogram mass2K0sP = RecoDecay::m(std::array{pVecBach, pVecV0}, std::array{massP, massK0s}); - if (mass2K0sP < config.massPrK0sMin || mass2K0sP > config.massPrK0sMax) { - continue; - } - std::array posCasc = {0., 0., 0.}; if (config.useDCAFitter) { const auto& cascVtx = df2.getPCACandidate(); From 717fe5362418d4dc6ff592b8dbc2028772315554 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 8 Sep 2024 12:36:01 +0200 Subject: [PATCH 59/60] Common: change bc study table (#7609) * Common: change bc study table * Please consider the following formatting changes (#341) --------- Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 29 ++++++++++++------- .../TableProducer/multiplicityExtraTable.cxx | 2 +- Common/Tasks/centralityStudy.cxx | 2 +- Common/Tasks/multiplicityQa.cxx | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index 7116ce66062..03c4888440d 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -77,9 +77,6 @@ DECLARE_SOA_COLUMN(MultNGlobalTracksPV, multNGlobalTracksPV, int); DECLARE_SOA_COLUMN(MultNGlobalTracksPVeta1, multNGlobalTracksPVeta1, int); DECLARE_SOA_COLUMN(MultNGlobalTracksPVetaHalf, multNGlobalTracksPVetaHalf, int); -DECLARE_SOA_INDEX_COLUMN(BC, bc); -DECLARE_SOA_INDEX_COLUMN(Collision, collision); - // even further QA: timing information for neighboring events DECLARE_SOA_COLUMN(TimeToPrePrevious, timeToPrePrevious, float); //! DECLARE_SOA_COLUMN(TimeToPrevious, timeToPrevious, float); //! @@ -112,12 +109,6 @@ using BarrelMults = soa::Join; using Mults = soa::Join; using Mult = Mults::iterator; -// for QA purposes -DECLARE_SOA_TABLE(Mults2BC, "AOD", "MULTS2BC", //! Relate mult -> BC - o2::soa::Index<>, mult::BCId); -DECLARE_SOA_TABLE(BC2Mults, "AOD", "BC2MULTS", //! Relate BC -> mult - o2::soa::Index<>, mult::CollisionId); - DECLARE_SOA_TABLE(MultsExtra, "AOD", "MULTEXTRA", //! mult::MultPVTotalContributors, mult::MultPVChi2, mult::MultCollisionTimeRes, mult::MultRunNumber, mult::MultPVz, mult::MultSel8, mult::MultNTracksHasITS, mult::MultNTracksHasTPC, mult::MultNTracksHasTOF, mult::MultNTracksHasTRD, @@ -197,7 +188,7 @@ DECLARE_SOA_COLUMN(MultBCFT0PosZ, multBCFT0PosZ, float); //! Position a DECLARE_SOA_COLUMN(MultBCFT0PosZValid, multBCFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information within the BC } // namespace multBC -DECLARE_SOA_TABLE(MultsBC, "AOD", "MULTBC", //! +DECLARE_SOA_TABLE(MultBCs, "AOD", "MULTBC", //! multBC::MultBCFT0A, multBC::MultBCFT0C, multBC::MultBCFT0PosZ, @@ -218,7 +209,23 @@ DECLARE_SOA_TABLE(MultsBC, "AOD", "MULTBC", //! multBC::MultBCFDDtriggerBits, multBC::MultBCTriggerMask, multBC::MultBCColliding); -using MultBC = MultsBC::iterator; +using MultBC = MultBCs::iterator; + +// crosslinks +namespace mult +{ +DECLARE_SOA_INDEX_COLUMN(MultBC, multBC); +} +namespace multBC +{ +DECLARE_SOA_INDEX_COLUMN(Mult, mult); +} + +// for QA purposes +DECLARE_SOA_TABLE(Mults2BC, "AOD", "MULTS2BC", //! Relate mult -> BC + o2::soa::Index<>, mult::MultBCId); +DECLARE_SOA_TABLE(BC2Mults, "AOD", "BC2MULTS", //! Relate BC -> mult + o2::soa::Index<>, multBC::MultId); } // namespace o2::aod diff --git a/Common/TableProducer/multiplicityExtraTable.cxx b/Common/TableProducer/multiplicityExtraTable.cxx index c3f1aa9cee3..075b0d108ee 100644 --- a/Common/TableProducer/multiplicityExtraTable.cxx +++ b/Common/TableProducer/multiplicityExtraTable.cxx @@ -30,7 +30,7 @@ using BCPattern = std::bitset; const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches; struct MultiplicityExtraTable { - Produces multBC; + Produces multBC; Produces multNeigh; Produces mult2bc; diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index f24fa99f9e2..1ba72958a37 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -203,7 +203,7 @@ struct centralityStudy { genericProcessCollision(collision); } - void processBCs(aod::MultsBC::iterator const& multbc) + void processBCs(aod::MultBCs::iterator const& multbc) { // process BCs, calculate FT0C distribution // conditionals suggested by FIT team (Jacek O. et al) diff --git a/Common/Tasks/multiplicityQa.cxx b/Common/Tasks/multiplicityQa.cxx index 72fc827606a..3bf0f769b79 100644 --- a/Common/Tasks/multiplicityQa.cxx +++ b/Common/Tasks/multiplicityQa.cxx @@ -402,7 +402,7 @@ struct MultiplicityQa { histos.fill(HIST("multiplicityQa/h2dFT0MVsNchT0M"), nchFT0, biggestFT0); } - void processFIT(aod::MultsBC const& multsdebug) + void processFIT(aod::MultBCs const& multsdebug) { for (auto& mult : multsdebug) { histos.fill(HIST("multiplicityQa/hIsolatedFT0A"), mult.multBCFT0A()); From f00ccdd8cf6c269f6dd09c53f8c116fe093faf36 Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:24:51 +0200 Subject: [PATCH 60/60] Missing vector clear on event change (#7590) * Missing vector reset * Removed redundant clear * clangformat --------- Co-authored-by: Emil Gorm Nielsen --- .../GenericFramework/Core/FlowPtContainer.cxx | 33 ++++++++++++------- PWGCF/GenericFramework/Core/FlowPtContainer.h | 2 ++ PWGCF/GenericFramework/Core/GFWConfig.h | 6 ++-- PWGCF/GenericFramework/Core/GFWPowerArray.cxx | 2 +- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx index 4faf529cbc5..6088da403a4 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx @@ -106,19 +106,22 @@ void FlowPtContainer::Initialise(const o2::framework::AxisSpec axis, const int& delete fCovList; fCovList = new TList(); fCovList->SetOwner(kTRUE); - for (int m = 0; m < mpar; ++m) + for (int m = 0; m < mpar; ++m) { fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("corr_%ipar", m + 1), nMultiBins, &multiBins[0])); + } for (int m = 0; m < 4; ++m) { - for (int i = 0; i <= m; ++i) + for (int i = 0; i <= m; ++i) { fCMTermList->Add(new BootstrapProfile(Form("cm%i_Mpt%i", m + 1, i), Form("cm%i_Mpt%i", m + 1, i), nMultiBins, &multiBins[0])); + } } for (int i = 0; i < configs.GetSize(); ++i) { for (auto m(1); m <= mpar; ++m) { if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1)))) continue; if (fUseCentralMoments) { - for (auto j = 0; j < m; ++j) + for (auto j = 0; j < m; ++j) { fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), nMultiBins, &multiBins[0])); + } } else { fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nMultiBins, &multiBins[0])); } @@ -147,19 +150,22 @@ void FlowPtContainer::Initialise(int nbinsx, double* xbins, const int& m, const delete fCorrList; fCorrList = new TList(); fCorrList->SetOwner(kTRUE); - for (int m = 0; m < mpar; ++m) + for (int m = 0; m < mpar; ++m) { fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("mpt%i", m + 1), nbinsx, xbins)); + } for (int m = 0; m < 4; ++m) { - for (int i = 0; i <= m; ++i) + for (int i = 0; i <= m; ++i) { fCMTermList->Add(new BootstrapProfile(Form("cm%i_Mpt%i", m + 1, i), Form("cm%i_Mpt%i", m + 1, i), nbinsx, xbins)); + } } for (int i = 0; i < configs.GetSize(); ++i) { for (auto m(1); m <= mpar; ++m) { if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1)))) continue; if (fUseCentralMoments) { - for (auto j = 0; j < m; ++j) + for (auto j = 0; j < m; ++j) { fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), nbinsx, xbins)); + } } else { fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nbinsx, xbins)); } @@ -187,19 +193,22 @@ void FlowPtContainer::Initialise(int nbinsx, double xlow, double xhigh, const in delete fCorrList; fCorrList = new TList(); fCorrList->SetOwner(kTRUE); - for (int m = 0; m < mpar; ++m) + for (int m = 0; m < mpar; ++m) { fCorrList->Add(new BootstrapProfile(Form("mpt%i", m + 1), Form("mpt%i", m + 1), nbinsx, xlow, xhigh)); + } for (int m = 0; m < 4; ++m) { - for (int i = 0; i <= m; ++i) + for (int i = 0; i <= m; ++i) { fCMTermList->Add(new BootstrapProfile(Form("cm%i_Mpt%i", m + 1, i), Form("cm%i_Mpt%i", m + 1, i), nbinsx, xlow, xhigh)); + } } for (int i = 0; i < configs.GetSize(); ++i) { for (auto m(1); m <= mpar; ++m) { if (!(configs.GetpTCorrMasks()[i] & (1 << (m - 1)))) continue; if (fUseCentralMoments) { - for (auto j = 0; j < m; ++j) + for (auto j = 0; j < m; ++j) { fCovList->Add(new BootstrapProfile(Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), Form("%spt%i_Mpt%i", configs.GetHeads()[i].c_str(), m, m - j - 1), nbinsx, xlow, xhigh)); + } } else { fCovList->Add(new BootstrapProfile(Form("%spt%i", configs.GetHeads()[i].c_str(), m), Form("%spt%i", configs.GetHeads()[i].c_str(), m), nbinsx, xlow, xhigh)); } @@ -217,7 +226,7 @@ void FlowPtContainer::Initialise(int nbinsx, double xlow, double xhigh, const in }; void FlowPtContainer::Fill(const double& w, const double& pt) { - for (auto i = 0; i < sumP.size(); ++i) { + for (size_t i = 0; i < sumP.size(); ++i) { sumP[i] += pow(w, i % (mpar + 1)) * pow(pt, i / (mpar + 1)); } return; @@ -279,7 +288,7 @@ void FlowPtContainer::FillVnDeltaPtProfiles(const double& centmult, const double continue; for (auto i = 0; i < m; ++i) { if (cmDen[m - 1] != 0) - dynamic_cast(fCovList->At(fillCounter))->FillProfile(centmult, flowval * cmNum[m * (m - 1) / 2 + i], (fEventWeight == kUnity) ? 1.0 : flowtuples * cmDen[m - 1], rn); + dynamic_cast(fCovList->At(fillCounter))->FillProfile(centmult, flowval * cmNum[m * (m - 1) / 2 + (m - i)], (fEventWeight == kUnity) ? 1.0 : flowtuples * cmDen[m - 1], rn); ++fillCounter; } } @@ -332,7 +341,7 @@ double FlowPtContainer::OrderedAddition(std::vector vec) { double sum = 0; std::sort(vec.begin(), vec.end()); - for (int i = 0; i < vec.size(); i++) { + for (size_t i = 0; i < vec.size(); i++) { sum += vec[i]; } return sum; diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.h b/PWGCF/GenericFramework/Core/FlowPtContainer.h index fa9a46e200b..18cf8ae82ea 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.h +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.h @@ -81,6 +81,8 @@ class FlowPtContainer : public TNamed { sumP.clear(); sumP.resize((mpar + 1) * (mpar + 1)); + cmNum.clear(); + cmDen.clear(); fillCounter = 0; }; diff --git a/PWGCF/GenericFramework/Core/GFWConfig.h b/PWGCF/GenericFramework/Core/GFWConfig.h index 9c086acbef1..779d06b604e 100644 --- a/PWGCF/GenericFramework/Core/GFWConfig.h +++ b/PWGCF/GenericFramework/Core/GFWConfig.h @@ -35,7 +35,7 @@ int CheckSameSize(const std::vector& first) template int CheckSameSize(const std::vector& first, const std::vector&... rest) { - int size = first.size(); + size_t size = first.size(); bool allSameSize = ((size == rest.size()) && ...); return allSameSize ? size : -1; @@ -145,7 +145,7 @@ class GFWRegions auto Print() const { - for (auto i = 0; i < names.size(); ++i) { + for (size_t i = 0; i < names.size(); ++i) { LOGF(info, "{%s, %.1f, %.1f, %d, %d}", names[i].c_str(), etaminvals[i], etamaxvals[i], pTDifs[i], bitmasks[i]); } return; @@ -190,7 +190,7 @@ class GFWCorrConfigs auto Print() const { - for (auto i = 0; i < corrs.size(); ++i) { + for (size_t i = 0; i < corrs.size(); ++i) { LOGF(info, "{%s,%s,%d,%d}", heads[i].c_str(), corrs[i].c_str(), pTDifs[i], pTCorrMasks[i]); } return; diff --git a/PWGCF/GenericFramework/Core/GFWPowerArray.cxx b/PWGCF/GenericFramework/Core/GFWPowerArray.cxx index 82291e507a2..609b235ec6f 100644 --- a/PWGCF/GenericFramework/Core/GFWPowerArray.cxx +++ b/PWGCF/GenericFramework/Core/GFWPowerArray.cxx @@ -52,7 +52,7 @@ void GFWPowerArray::RecursiveFunction(HarSet& masterVector, HarSet hars, int off { HarSet compVec = AddConstant(hars, offset); FlushVectorToMaster(masterVector, compVec, MaxPower); - for (int i = 0; i < hars.size(); i++) + for (size_t i = 0; i < hars.size(); i++) RecursiveFunction(masterVector, TrimVec(hars, i), offset + hars.at(i), MaxPower); ; };