From 0dfd90a710779eb762660bbb57c437cc5c0bcf8a Mon Sep 17 00:00:00 2001 From: contrgui Date: Sat, 28 Nov 2026 15:49:38 +0100 Subject: [PATCH 1/2] Improving counting interactions in ROF --- PWGUD/Tasks/upcVmRof.cxx | 59 +++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/PWGUD/Tasks/upcVmRof.cxx b/PWGUD/Tasks/upcVmRof.cxx index ebb238d81bf..7fecfe5c113 100644 --- a/PWGUD/Tasks/upcVmRof.cxx +++ b/PWGUD/Tasks/upcVmRof.cxx @@ -109,6 +109,9 @@ DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); +DECLARE_SOA_COLUMN(PerROFZNA, perROFZNA, int); +DECLARE_SOA_COLUMN(PerROFZNC, perROFZNC, int); +DECLARE_SOA_COLUMN(PerROFZN, perROFZN, int); // track info DECLARE_SOA_COLUMN(Pt1, pt1, float); @@ -198,7 +201,8 @@ DECLARE_SOA_TABLE(TwoTrkTable, "AOD", "TWOTRKTABLE", datarows::EnergyCommonZNA, datarows::EnergyCommonZNC, datarows::TimeZNA, datarows::TimeZNC, datarows::Pt1, datarows::Eta1, datarows::Phi1, datarows::Q1, datarows::PidPion1, datarows::PidElectron1, datarows::PidKaon1, datarows::PidProton1, datarows::Pt2, datarows::Eta2, datarows::Phi2, datarows::Q2, datarows::PidPion2, datarows::PidElectron2, datarows::PidKaon2, datarows::PidProton2, - datarows::HasTof1, datarows::HasTof2, datarows::PerROFFT0Low, datarows::PerROFFT0High); + datarows::HasTof1, datarows::HasTof2, datarows::PerROFFT0Low, datarows::PerROFFT0High, + datarows::PerROFZNA, datarows::PerROFZNC, datarows::PerROFZN); DECLARE_SOA_TABLE(FourTrkTable, "AOD", "FOURTRKTABLE", datarows::RunNumber, datarows::PosX, datarows::PosY, datarows::PosZ, datarows::Chi2, datarows::LocalBC, datarows::NearestBCB, datarows::LocalTF, datarows::LocalROF, datarows::UpcFlag, @@ -210,7 +214,8 @@ DECLARE_SOA_TABLE(FourTrkTable, "AOD", "FOURTRKTABLE", datarows::Pt2, datarows::Eta2, datarows::Phi2, datarows::Q2, datarows::PidPion2, datarows::PidElectron2, datarows::PidKaon2, datarows::PidProton2, datarows::Pt3, datarows::Eta3, datarows::Phi3, datarows::Q3, datarows::PidPion3, datarows::PidElectron3, datarows::PidKaon3, datarows::PidProton3, datarows::Pt4, datarows::Eta4, datarows::Phi4, datarows::Q4, datarows::PidPion4, datarows::PidElectron4, datarows::PidKaon4, datarows::PidProton4, - datarows::HasTof1, datarows::HasTof2, datarows::HasTof3, datarows::HasTof4, datarows::PerROFFT0Low, datarows::PerROFFT0High); + datarows::HasTof1, datarows::HasTof2, datarows::HasTof3, datarows::HasTof4, datarows::PerROFFT0Low, datarows::PerROFFT0High, + datarows::PerROFZNA, datarows::PerROFZNC, datarows::PerROFZN); DECLARE_SOA_TABLE(TwoTrkRecGenTable, "AOD", "TWOTRKRECGEN", mcgen::McMotherPdg, mcgen::McMotherPt, mcgen::McMotherPhi, mcgen::McMotherMass, mcgen::McMotherRapidity, @@ -305,6 +310,7 @@ struct UpcVmRof { // information for selection collisions Configurable maxAbsPosZ{"maxAbsPosZ", 10.0, "max |Z| position of vtx"}; + Configurable maxAbsTimeZN{"maxAbsTimeZN", 2.0, "max |time| in a ZN side"}; Configurable maxAbsTimeFT0{"maxAbsTimeFT0", 4.0, "max |time| in a FT0 side"}; Configurable maxAmpFT0{"maxAmpFT0", 150.0, "max amplitude for signals in a FT0 side"}; Configurable minAmpFT0Low{"minAmpFT0Low", 50.0, "min amplitude for signals in a FT0 side to define an interaction, low threshold"}; @@ -918,6 +924,7 @@ struct UpcVmRof { if (gidxBCB <= bcs.iteratorAt(bcs.size() - 1).globalIndex()) { while (nearbcb != bcs.end()) { ++nearbcb; + if (nearbcb == bcs.end()) break; if (nearbcb.globalIndex() > gidxBCB) { break; } else if (getBcWithinOrbit(nearbcb.globalBC()) == vecNearestBCB[thisBC]) { @@ -1089,14 +1096,18 @@ struct UpcVmRof { colTH1Pointers[Form("colSel/%d/trkDcaXY_H", runNumberCol)]->Fill(selTrks[itrk].dcaXY()); } - // compute the number of FT0 interactions in this ROF - int nPerROFFT0Low = 0; - int nPerROFFT0High = 0; - // -- FT0: find interactions in the same ROF + // compute the number of FT0 and ZN bcB interactions in this ROF + int nPerROFFT0Low = 0; // Low amplitude threshold + int nPerROFFT0High = 0; // high amplitude threshold + int nPerROFZNA = 0; + int nPerROFZNC = 0; + int nPerROFZN = 0; + // -- find interactions in the same ROF auto fwdbc = bcs.iteratorAt(nearbcb.globalIndex()); - // -- FT0: find later interactions in the same ROF + // -- find later interactions in the same ROF while (fwdbc != bcs.end()) { ++fwdbc; + if (fwdbc == bcs.end()) break; int64_t tmpLocalBC = getBcWithinOrbit(fwdbc.globalBC()); int64_t tmpTF = getTimeFrame(fwdbc.globalBC()); int64_t tmpROF = getRof(tmpLocalBC); @@ -1104,6 +1115,20 @@ struct UpcVmRof { break; if (tmpROF != nearbcbROF) break; + if (!bcPatternB.test(tmpLocalBC)) { + continue; + } + if (fwdbc.has_zdc()) { + tZNA = (fwdbc.zdc()).timeZNA(); + tZNC = (fwdbc.zdc()).timeZNC(); + bool isZNA = false; + bool isZNC = false; + if(std::isfinite(tZNA) && std::abs(tZNA) minAmpFT0Low && fwdbc.foundFT0().sumAmpC() > minAmpFT0Low) nPerROFFT0Low++; @@ -1111,7 +1136,7 @@ struct UpcVmRof { nPerROFFT0High++; } } - // -- FT0: find earlier interactions in the same ROF + // -- find earlier interactions in the same ROF auto bwdbc = bcs.iteratorAt(nearbcb.globalIndex()); while (bwdbc != bcs.iteratorAt(0)) { --bwdbc; @@ -1122,6 +1147,20 @@ struct UpcVmRof { break; if (tmpROF != nearbcbROF) break; + if (!bcPatternB.test(tmpLocalBC)) { + continue; + } + if (bwdbc.has_zdc()) { + tZNA = (bwdbc.zdc()).timeZNA(); + tZNC = (bwdbc.zdc()).timeZNC(); + bool isZNA = false; + bool isZNC = false; + if(std::isfinite(tZNA) && std::abs(tZNA) minAmpFT0Low && bwdbc.foundFT0().sumAmpC() > minAmpFT0Low) nPerROFFT0Low++; @@ -1148,7 +1187,7 @@ struct UpcVmRof { selTrks[0].tpcNSigmaPi(), selTrks[0].tpcNSigmaEl(), selTrks[0].tpcNSigmaKa(), selTrks[0].tpcNSigmaPr(), selTrks[1].pt(), selTrks[1].eta(), selTrks[1].phi(), selTrks[1].sign(), selTrks[1].tpcNSigmaPi(), selTrks[1].tpcNSigmaEl(), selTrks[1].tpcNSigmaKa(), selTrks[1].tpcNSigmaPr(), - tof[0], tof[1], nPerROFFT0Low, nPerROFFT0High); + tof[0], tof[1], nPerROFFT0Low, nPerROFFT0High, nPerROFZNA, nPerROFZNC, nPerROFZN); } if (isFourBody) { if (selTrks[0].hasTOF()) { @@ -1175,7 +1214,7 @@ struct UpcVmRof { selTrks[2].tpcNSigmaPi(), selTrks[2].tpcNSigmaEl(), selTrks[2].tpcNSigmaKa(), selTrks[2].tpcNSigmaPr(), selTrks[3].pt(), selTrks[3].eta(), selTrks[3].phi(), selTrks[3].sign(), selTrks[3].tpcNSigmaPi(), selTrks[3].tpcNSigmaEl(), selTrks[3].tpcNSigmaKa(), selTrks[3].tpcNSigmaPr(), - tof[0], tof[1], tof[2], tof[3], nPerROFFT0Low, nPerROFFT0High); + tof[0], tof[1], tof[2], tof[3], nPerROFFT0Low, nPerROFFT0High, nPerROFZNA, nPerROFZNC, nPerROFZN); } outIsTwoBody = isTwoBody; From 1eaf81744975b6d6e622b12b78ee5fd05bef1e37 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sat, 28 Nov 2026 14:53:41 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGUD/Tasks/upcVmRof.cxx | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/PWGUD/Tasks/upcVmRof.cxx b/PWGUD/Tasks/upcVmRof.cxx index 7fecfe5c113..97767d4787a 100644 --- a/PWGUD/Tasks/upcVmRof.cxx +++ b/PWGUD/Tasks/upcVmRof.cxx @@ -924,7 +924,8 @@ struct UpcVmRof { if (gidxBCB <= bcs.iteratorAt(bcs.size() - 1).globalIndex()) { while (nearbcb != bcs.end()) { ++nearbcb; - if (nearbcb == bcs.end()) break; + if (nearbcb == bcs.end()) + break; if (nearbcb.globalIndex() > gidxBCB) { break; } else if (getBcWithinOrbit(nearbcb.globalBC()) == vecNearestBCB[thisBC]) { @@ -1097,7 +1098,7 @@ struct UpcVmRof { } // compute the number of FT0 and ZN bcB interactions in this ROF - int nPerROFFT0Low = 0; // Low amplitude threshold + int nPerROFFT0Low = 0; // Low amplitude threshold int nPerROFFT0High = 0; // high amplitude threshold int nPerROFZNA = 0; int nPerROFZNC = 0; @@ -1107,7 +1108,8 @@ struct UpcVmRof { // -- find later interactions in the same ROF while (fwdbc != bcs.end()) { ++fwdbc; - if (fwdbc == bcs.end()) break; + if (fwdbc == bcs.end()) + break; int64_t tmpLocalBC = getBcWithinOrbit(fwdbc.globalBC()); int64_t tmpTF = getTimeFrame(fwdbc.globalBC()); int64_t tmpROF = getRof(tmpLocalBC); @@ -1123,11 +1125,16 @@ struct UpcVmRof { tZNC = (fwdbc.zdc()).timeZNC(); bool isZNA = false; bool isZNC = false; - if(std::isfinite(tZNA) && std::abs(tZNA) minAmpFT0Low && fwdbc.foundFT0().sumAmpC() > minAmpFT0Low) @@ -1155,11 +1162,16 @@ struct UpcVmRof { tZNC = (bwdbc.zdc()).timeZNC(); bool isZNA = false; bool isZNC = false; - if(std::isfinite(tZNA) && std::abs(tZNA) minAmpFT0Low && bwdbc.foundFT0().sumAmpC() > minAmpFT0Low) @@ -1187,7 +1199,7 @@ struct UpcVmRof { selTrks[0].tpcNSigmaPi(), selTrks[0].tpcNSigmaEl(), selTrks[0].tpcNSigmaKa(), selTrks[0].tpcNSigmaPr(), selTrks[1].pt(), selTrks[1].eta(), selTrks[1].phi(), selTrks[1].sign(), selTrks[1].tpcNSigmaPi(), selTrks[1].tpcNSigmaEl(), selTrks[1].tpcNSigmaKa(), selTrks[1].tpcNSigmaPr(), - tof[0], tof[1], nPerROFFT0Low, nPerROFFT0High, nPerROFZNA, nPerROFZNC, nPerROFZN); + tof[0], tof[1], nPerROFFT0Low, nPerROFFT0High, nPerROFZNA, nPerROFZNC, nPerROFZN); } if (isFourBody) { if (selTrks[0].hasTOF()) {