From d829b949e1883f8c3049593fb59bee80d629ade0 Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Wed, 30 Sep 2026 10:51:48 +0800 Subject: [PATCH 1/3] fix zdc gapside selection --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 33 +++++++++-------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index d708c17e5ae..a1dae010e98 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -78,7 +78,6 @@ struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 2.0, "dcaz cut") O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2") 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") @@ -122,11 +121,7 @@ struct FlowCorrelationsUpc { // make the filters and cuts. Filter trackFilter = (aod::udtrack::isPVContributor == true); - Filter collisionFilter = cfgGapSideMerge - ? ((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)); + Filter collisionFilter = ((aod::udcollision::gapSide == (uint8_t)cfgGapSide) && (aod::upcservice::truegapside == cfgGapSide)); // Connect to ccdb Service ccdb{}; @@ -264,13 +259,13 @@ struct FlowCorrelationsUpc { registry.fill(HIST("neutronClass"), 0, 0); } if (std::abs(timeZNA) <= cfgZdcTimeCut && std::abs(timeZNC) > cfgZdcTimeCut) { - neutronClass = 1; - registry.fill(HIST("neutronClass"), 0, 1); - } - if (std::abs(timeZNA) > cfgZdcTimeCut && std::abs(timeZNC) <= cfgZdcTimeCut) { neutronClass = 2; registry.fill(HIST("neutronClass"), 1, 0); } + if (std::abs(timeZNA) > cfgZdcTimeCut && std::abs(timeZNC) <= cfgZdcTimeCut) { + neutronClass = 1; + registry.fill(HIST("neutronClass"), 0, 1); + } if (std::abs(timeZNA) <= cfgZdcTimeCut && std::abs(timeZNC) <= cfgZdcTimeCut) { neutronClass = 3; registry.fill(HIST("neutronClass"), 1, 1); @@ -281,15 +276,11 @@ struct FlowCorrelationsUpc { return false; } // if A or C gap is requested, keep corresponding neutron class - if (cfgGapSideMerge) { - // accepted - } else { - if (cfgGapSide == 0 || cfgGapSide == 1) { - if ((cfgGapSide == 0 && neutronClass == 1) || (cfgGapSide == 1 && neutronClass == 2)) { // o2-linter: disable=magic-number (ZDC time cut) - // accepted - } else { - return false; - } + if (cfgGapSide == 0 || cfgGapSide == 1) { + if ((cfgGapSide == 0 && neutronClass == 1) || (cfgGapSide == 1 && neutronClass == 2)) { // o2-linter: disable=magic-number (ZDC time cut) + // accepted + } else { + return false; } } } @@ -332,10 +323,6 @@ struct FlowCorrelationsUpc { return false; } - if (!zdcTimeCut(collision)) { - return false; - } - return true; } From 5266f52cfd7860bb5d2cb378a9b7501f6507d3a8 Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Thu, 8 Oct 2026 14:20:41 +0800 Subject: [PATCH 2/3] fix filter --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 623265a92d4..b4d5e1ee93b 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -77,7 +77,7 @@ struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz") O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 2.0, "dcaz cut") O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2") - O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 1, "choose one side 0:A; 1:C") + O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 0, "choose one side 0:A; 1:C") 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") @@ -90,7 +90,7 @@ struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgRctFlagEnabled, bool, false, "use run condition table flag") O2_DEFINE_CONFIGURABLE(cfgRctFlagIndex, int, 1, "1: isCBTOk; 2:isCBTZdcOk; 3: isCBTHadronOk; 4:isCBTHadronZdcOk ") O2_DEFINE_CONFIGURABLE(cfgIRMaxCut, double, 50, "maximum interaction rate for UPC events") - O2_DEFINE_CONFIGURABLE(cfgZdcTime, bool, false, "choose zdc time cut") + O2_DEFINE_CONFIGURABLE(cfgZdcTime, bool, true, "choose zdc time cut") O2_DEFINE_CONFIGURABLE(cfgZdcTimeCut, float, 2.0, "zdc time cut") O2_DEFINE_CONFIGURABLE(cfgSbp, bool, true, "choose sbp") O2_DEFINE_CONFIGURABLE(cfgvtxITSTPC, bool, true, "choose vtxITSTPC") @@ -121,7 +121,12 @@ struct FlowCorrelationsUpc { // make the filters and cuts. Filter trackFilter = (aod::udtrack::isPVContributor == true); - Filter collisionFilter = ((aod::udcollision::gapSide == (uint8_t)cfgGapSide) && (aod::upcservice::truegapside == cfgGapSide)); + Filter collisionFilter = ifnode( + cfgGapSide.node() == 0, + ((aod::udcollision::gapSide == static_cast(0)) && + (aod::upcservice::truegapside == 0)), + ((aod::udcollision::gapSide == static_cast(1)) && + (aod::upcservice::truegapside == 1))); // Connect to ccdb Service ccdb{}; From f4f1e50031b01ecc0fe0ea29e6155f67c3c8a0cc Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Thu, 22 Oct 2026 15:20:28 +0800 Subject: [PATCH 3/3] add Nchvsetagaps --- PWGUD/Tasks/flowCumulantsUpc.cxx | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/PWGUD/Tasks/flowCumulantsUpc.cxx b/PWGUD/Tasks/flowCumulantsUpc.cxx index 19f29620a21..01bf6d76a7c 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -159,6 +160,7 @@ struct FlowCumulantsUpc { TRandom3* fRndmMc = new TRandom3(0); int lastRunNumber = -1; std::vector runNumbers; + std::map neventsIdBins; std::map> th3sPerRun; // map of TH3 histograms for all runs using UdTracks = soa::Join; @@ -320,6 +322,26 @@ struct FlowCumulantsUpc { } } } + + // One Y bin for every FlowContainer IDName already stored in oba. + const int nIdNames = oba->GetEntries(); + + const AxisSpec axisIdName{nIdNames, 0.5, static_cast(nIdNames) + 0.5, "ID name"}; + + registry.add("hNeventsVsNch", "Selected events;N_{ch};ID name", {HistType::kTH2D, {axisIndependent, axisIdName}}); + + auto hNeventsVsNch = registry.get(HIST("hNeventsVsNch")); + + for (int i = 0; i < nIdNames; ++i) { + auto* observable = dynamic_cast(oba->At(i)); + if (!observable) { + continue; + } + const std::string idName = observable->GetName(); + const int yBin = i + 1; + neventsIdBins[idName] = yBin; + hNeventsVsNch->GetYaxis()->SetBinLabel(yBin, idName.c_str()); + } fFC->SetName("FlowContainer"); fFC->SetXAxis(fPtAxis); fFC->Initialize(oba, axisIndependent, cfgNbootstrap); @@ -520,6 +542,16 @@ struct FlowCumulantsUpc { fGFW->CreateRegions(); } + void fillNeventsVsNch(const std::string& idName, double independent) + { + const auto it = neventsIdBins.find(idName); + if (it == neventsIdBins.end()) { + return; + } + + registry.fill(HIST("hNeventsVsNch"), independent, static_cast(it->second)); + } + void createOutputObjectsForRun(int runNumber) { const AxisSpec axisPhi{60, 0.0, constants::math::TwoPI, "#varphi"}; @@ -538,6 +570,7 @@ struct FlowCumulantsUpc { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; if (std::fabs(val) < 1) { fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); + fillNeventsVsNch(corrconf.Head, cent); } return; }