From cc619eb41d7fd1b26c938c171fb791bb1b0565ac Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Mon, 11 May 2026 16:26:54 +0800 Subject: [PATCH] use truegapside producer --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 158 +++++++++++++--------------- 1 file changed, 72 insertions(+), 86 deletions(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 64bae3adc4c..a7ee9ea3dfb 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -18,6 +18,7 @@ #include "PWGCF/GenericFramework/Core/GFWWeights.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" +#include "PWGUD/DataModel/UDTruegapsideTables.h" #include "Common/Core/RecoDecay.h" @@ -50,17 +51,17 @@ #include #include -namespace o2::aod -{ -namespace flowcorrupc -{ -DECLARE_SOA_COLUMN(Multiplicity, multiplicity, int); -DECLARE_SOA_COLUMN(Truegapside, truegapside, int); -} // namespace flowcorrupc -DECLARE_SOA_TABLE(Multiplicity, "AOD", "MULTIPLICITY", - flowcorrupc::Multiplicity); -DECLARE_SOA_TABLE(Truegapside, "AOD", "TRUEGAPSIDE", flowcorrupc::Truegapside); -} // namespace o2::aod +// namespace o2::aod +// { +// namespace flowcorrupc +// { +// DECLARE_SOA_COLUMN(Multiplicity, multiplicity, int); +// DECLARE_SOA_COLUMN(Truegapside, truegapside, int); +// } // namespace flowcorrupc +// DECLARE_SOA_TABLE(Multiplicity, "AOD", "MULTIPLICITY", +// flowcorrupc::Multiplicity); +// DECLARE_SOA_TABLE(Truegapside, "AOD", "TRUEGAPSIDE", flowcorrupc::Truegapside); +// } // namespace o2::aod using namespace o2; using namespace o2::framework; @@ -70,57 +71,57 @@ using namespace o2::constants::math; // define the filtered collisions and tracks #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; -struct CalcNchUpc { - O2_DEFINE_CONFIGURABLE(cfgZVtxCut, float, 10.0f, "Accepted z-vertex range") - O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "minimum accepted track pT") - O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.9f, "Eta cut") - O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix") - - // Added UPC Cuts - SGSelector sgSelector; - Configurable cfgCutFV0{"cfgCutFV0", 50., "FV0A threshold"}; - Configurable cfgCutFT0A{"cfgCutFT0A", 150., "FT0A threshold"}; - Configurable cfgCutFT0C{"cfgCutFT0C", 50., "FT0C threshold"}; - Configurable cfgCutZDC{"cfgCutZDC", 10., "ZDC threshold"}; - - // Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); - - using UdTracks = soa::Join; - using UdTracksFull = soa::Join; - using UDCollisionsFull = soa::Join; - - Produces multiplicityNch; - Produces truegapside; - - HistogramRegistry registry{"registry"}; - - void init(InitContext&) - { - AxisSpec axisNch = {100, 0, 100}; - AxisSpec axisVrtx = {10, -10, 10}; - // AxisSpec axisgap = {12, -6, 6}; - // std::vector trueGapBins = {-2, -1, 0, 1, 2, 3}; - // AxisSpec axisgap = {trueGapBins, "true gap side"}; - - std::vector binEdges = {-1.5, -0.5, 0.5, 1.5, 2.5, 3.5}; - AxisSpec axisgap = {binEdges, "true gap side"}; - registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}}); - - registry.add("Ncharge", "N_{charge}", {HistType::kTH1D, {axisNch}}); - registry.add("zVtx_all", "zVtx_all", {HistType::kTH1D, {axisVrtx}}); - registry.add("Nch_vs_zVtx", "Nch vs zVtx", {HistType::kTH2D, {axisVrtx, axisNch}}); - // registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}}); - } - - void process(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks) - { - multiplicityNch(tracks.size()); - truegapside(sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC)); - // LOG(info) << "truegapside=" << sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); - registry.fill(HIST("Ncharge"), tracks.size()); - registry.fill(HIST("zVtx_all"), collision.posZ()); - } -}; +// struct CalcNchUpc { +// O2_DEFINE_CONFIGURABLE(cfgZVtxCut, float, 10.0f, "Accepted z-vertex range") +// O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "minimum accepted track pT") +// O2_DEFINE_CONFIGURABLE(cfgEtaCut, float, 0.9f, "Eta cut") +// O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix") + +// // Added UPC Cuts +// SGSelector sgSelector; +// Configurable cfgCutFV0{"cfgCutFV0", 50., "FV0A threshold"}; +// Configurable cfgCutFT0A{"cfgCutFT0A", 150., "FT0A threshold"}; +// Configurable cfgCutFT0C{"cfgCutFT0C", 50., "FT0C threshold"}; +// Configurable cfgCutZDC{"cfgCutZDC", 10., "ZDC threshold"}; + +// // Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); + +// using UdTracks = soa::Join; +// using UdTracksFull = soa::Join; +// using UDCollisionsFull = soa::Join; + +// Produces multiplicityNch; +// Produces truegapside; + +// HistogramRegistry registry{"registry"}; + +// void init(InitContext&) +// { +// AxisSpec axisNch = {100, 0, 100}; +// AxisSpec axisVrtx = {10, -10, 10}; +// // AxisSpec axisgap = {12, -6, 6}; +// // std::vector trueGapBins = {-2, -1, 0, 1, 2, 3}; +// // AxisSpec axisgap = {trueGapBins, "true gap side"}; + +// std::vector binEdges = {-1.5, -0.5, 0.5, 1.5, 2.5, 3.5}; +// AxisSpec axisgap = {binEdges, "true gap side"}; +// registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}}); + +// registry.add("Ncharge", "N_{charge}", {HistType::kTH1D, {axisNch}}); +// registry.add("zVtx_all", "zVtx_all", {HistType::kTH1D, {axisVrtx}}); +// registry.add("Nch_vs_zVtx", "Nch vs zVtx", {HistType::kTH2D, {axisVrtx, axisNch}}); +// // registry.add("truegap", "truegap", {HistType::kTH1D, {axisgap}}); +// } + +// void process(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks) +// { +// multiplicityNch(tracks.size()); +// truegapside(sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC)); +// // LOG(info) << "truegapside=" << sgSelector.trueGap(collision, cfgCutFV0, cfgCutFT0A, cfgCutFT0C, cfgCutZDC); +// registry.fill(HIST("Ncharge"), tracks.size()); +// registry.fill(HIST("zVtx_all"), collision.posZ()); +// } +// }; struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgZVtxCut, float, 10.0f, "Accepted z-vertex range") @@ -141,9 +142,8 @@ struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz") O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut") O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2") - O2_DEFINE_CONFIGURABLE(cfgCutOccupancy, bool, true, "Occupancy cut") - O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 1000, "High cut on TPC occupancy") - O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy") + O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 1, "choose one side 0:A; 1:C") + O2_DEFINE_CONFIGURABLE(cfgGapSideMerge, bool, true, "merge A and C side") O2_DEFINE_CONFIGURABLE(cfgCutTPCCrossedRows, float, 70.0f, "minimum number of crossed TPC Rows") O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 50.0f, "minimum number of found TPC clusters") O2_DEFINE_CONFIGURABLE(cfgCutITSclu, float, 5.0f, "minimum number of ITS clusters") @@ -184,7 +184,11 @@ struct FlowCorrelationsUpc { // make the filters and cuts. Filter trackFilter = (aod::udtrack::isPVContributor == true); - Filter collisionFilter = ((aod::udcollision::gapSide == (uint8_t)1 || aod::udcollision::gapSide == (uint8_t)0) && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (!cfgCutOccupancy || (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh)) && (aod::flowcorrupc::truegapside == 1 || aod::flowcorrupc::truegapside == 0)); + Filter collisionFilter = (cfgGapSideMerge == true) + ? ((aod::udcollision::gapSide == (uint8_t)0 || aod::udcollision::gapSide == (uint8_t)1) && + (aod::upcservice::truegapside == 0 || aod::upcservice::truegapside == 1)) + : ((aod::udcollision::gapSide == (uint8_t)cfgGapSide) && + (aod::upcservice::truegapside == cfgGapSide)); // Connect to ccdb Service ccdb; @@ -200,7 +204,7 @@ struct FlowCorrelationsUpc { using UdTracks = soa::Filtered>; using UdTracksFull = soa::Filtered>; - using UDCollisionsFull = soa::Filtered>; + using UDCollisionsFull = soa::Filtered>; // Define the outputs OutputObj same{Form("sameEvent_%i_%i", static_cast(cfgMinMult), static_cast(cfgMaxMult))}; @@ -358,21 +362,6 @@ struct FlowCorrelationsUpc { weight_nue = 1. / eff; return true; } - - bool setCurrentParticleWeights(float& weight_nue, float& weight_nua, float pt) - { - float eff = 1.; - if (mEfficiency) - eff = mEfficiency->GetBinContent(mEfficiency->FindBin(pt)); - else - eff = 1.0; - if (eff == 0) - return false; - weight_nue = 1. / eff; - weight_nua = 1.; // Set to 1 as NUA weight is not being used - return true; - } - // fill multiple histograms template void fillYield(TCollision collision, TTracks tracks, float vtxz) // function to fill the yield and etaphi histograms. @@ -430,9 +419,6 @@ struct FlowCorrelationsUpc { // 计算track1的权重 float weff1 = 1., wacc1 = 1.; - if (!setCurrentParticleWeights(weff1, wacc1, pt1)) - continue; - if (system == SameEvent) { registry.fill(HIST("Trig_hist"), fSampleIndex, posZ, independent, pt1, eventWeight * weff1 * wacc1); } @@ -621,7 +607,7 @@ struct FlowCorrelationsUpc { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), + // adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), }; }