From dcfad57a95f39a1ddcfd307c57da1c3449427750 Mon Sep 17 00:00:00 2001 From: Omar Vazquez Date: Fri, 4 Jul 2025 18:17:43 -0600 Subject: [PATCH 1/2] Adds process function for Poisson bootstrap --- PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx | 267 +++++++++++++++++++ 1 file changed, 267 insertions(+) diff --git a/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx b/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx index 4378ff6e089..75db937ed13 100644 --- a/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx @@ -37,6 +37,7 @@ #include "TPDGCode.h" #include +#include #include #include @@ -46,6 +47,7 @@ #include #include #include +#include #include using namespace std; @@ -65,6 +67,16 @@ using SimCollisions = soa::Join; } // namespace o2::aod +static constexpr int kSizeBootStrapEnsemble{8}; + +std::array, kSizeBootStrapEnsemble> hPoisson{}; +std::array, kSizeBootStrapEnsemble> hNch{}; +std::array, kSizeBootStrapEnsemble> pNchVsOneParCorr{}; +std::array, kSizeBootStrapEnsemble> pNchVsOneParCorrVsZN{}; +std::array, kSizeBootStrapEnsemble> pNchVsTwoParCorrVsZN{}; +std::array, kSizeBootStrapEnsemble> pNchVsThreeParCorrVsZN{}; +std::array, kSizeBootStrapEnsemble> pNchVsFourParCorrVsZN{}; + struct UccZdc { static constexpr float kCollEnergy{2.68}; @@ -229,6 +241,18 @@ struct UccZdc { registry.add("NchVsFourParCorrVsZN", ";#it{N}_{ch} (|#eta| < 0.8, Corrected);ZNA+ZNC;#LT[#it{p}_{T}^{(4)}]#GT", kTProfile2D, {{{nBinsNch, minNch, maxNch}, {nBinsZN, -0.5, maxZN}}}); } + if (doprocessEventSampling) { + for (int i = 0; i < kSizeBootStrapEnsemble; i++) { + hNch[i] = registry.add(Form("Nch_Replica%d", i), ";#it{N}_{ch} (|#eta| < 0.8);Entries", kTH1F, {{nBinsNch, minNch, maxNch}}); + hPoisson[i] = registry.add(Form("Poisson_Replica%d", i), ";#it{k};Entries", kTH1F, {{21, -0.5, 20.5}}); + pNchVsOneParCorrVsZN[i] = registry.add(Form("NchVsOneParCorrVsZN_Replica%d", i), ";#it{N}_{ch}, |#eta| < 0.8; ZNA+ZNC; #LT[#it{p}_{T}^{(1)}]#GT (GeV/#it{c})", kTProfile2D, {{{nBinsNch, minNch, maxNch}, {nBinsZN, -0.5, maxZN}}}); + pNchVsTwoParCorrVsZN[i] = registry.add(Form("NchVsTwoParCorrVsZN_Replica%d", i), ";#it{N}_{ch}, |#eta| < 0.8; ZNA+ZNC; #LT[#it{p}_{T}^{(1)}]#GT (GeV/#it{c})", kTProfile2D, {{{nBinsNch, minNch, maxNch}, {nBinsZN, -0.5, maxZN}}}); + pNchVsThreeParCorrVsZN[i] = registry.add(Form("NchVsThreeParCorrVsZN_Replica%d", i), ";#it{N}_{ch}, |#eta| < 0.8; ZNA+ZNC; #LT[#it{p}_{T}^{(1)}]#GT (GeV/#it{c})", kTProfile2D, {{{nBinsNch, minNch, maxNch}, {nBinsZN, -0.5, maxZN}}}); + pNchVsFourParCorrVsZN[i] = registry.add(Form("NchVsFourParCorrVsZN_Replica%d", i), ";#it{N}_{ch}, |#eta| < 0.8; ZNA+ZNC; #LT[#it{p}_{T}^{(1)}]#GT (GeV/#it{c})", kTProfile2D, {{{nBinsNch, minNch, maxNch}, {nBinsZN, -0.5, maxZN}}}); + pNchVsOneParCorr[i] = registry.add(Form("NchVsOneParCorr_Replica%d", i), ";#it{N}_{ch}, |#eta| < 0.8;#LT[#it{p}_{T}^{(1)}]#GT (GeV/#it{c})", kTProfile, {{nBinsNch, minNch, maxNch}}); + } + } + if (doprocessMCclosure) { registry.add("RandomNumber", "", kTH1F, {{50, 0., 1.}}); registry.add("EvtsDivided", ";Event type;Entries;", kTH1F, {{2, -0.5, 1.5}}); @@ -826,6 +850,249 @@ struct UccZdc { } PROCESS_SWITCH(UccZdc, processZdcCollAss, "Process ZDC W/Coll Ass.", true); + void processEventSampling(o2::aod::ColEvSels::iterator const& collision, o2::aod::BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/, aod::FV0As const& /*fv0as*/, aod::FT0s const& /*ft0s*/, TheFilteredTracks const& tracks) + { + if (!isEventSelected(collision)) { + return; + } + + const auto& foundBC = collision.foundBC_as(); + + // has ZDC? + if (!foundBC.has_zdc()) { + return; + } + registry.fill(HIST("hEventCounter"), EvCutLabel::Zdc); + + float aT0A = 0., aT0C = 0.; + if (foundBC.has_ft0()) { + for (const auto& amplitude : foundBC.ft0().amplitudeA()) { + aT0A += amplitude; + } + for (const auto& amplitude : foundBC.ft0().amplitudeC()) { + aT0C += amplitude; + } + } else { + return; + } + + registry.fill(HIST("hEventCounter"), EvCutLabel::TZero); + + const double normT0M{(aT0A + aT0C) / 100.}; + float znA{foundBC.zdc().amplitudeZNA()}; + float znC{foundBC.zdc().amplitudeZNC()}; + float aZEM1{foundBC.zdc().amplitudeZEM1()}; + float aZEM2{foundBC.zdc().amplitudeZEM2()}; + float tZNA{foundBC.zdc().timeZNA()}; + float tZNC{foundBC.zdc().timeZNC()}; + float tZPA{foundBC.zdc().timeZPA()}; + float tZPC{foundBC.zdc().timeZPC()}; + float tZDCdif{tZNC + tZPC - tZNA - tZPA}; + float tZDCsum{tZNC + tZPC + tZNA + tZPA}; + znA /= kCollEnergy; + znC /= kCollEnergy; + float sumZNs{znA + znC}; + float sumZEMs{aZEM1 + aZEM2}; + + // TDC cut + if (isTDCcut) { + if (std::sqrt(std::pow(tZDCdif, 2.) + std::pow(tZDCsum, 2.)) > tdcCut) { + return; + } + registry.fill(HIST("hEventCounter"), EvCutLabel::Tdc); + } + + // ZEM cut + if (isZEMcut) { + if (sumZEMs < zemCut) { + return; + } + registry.fill(HIST("hEventCounter"), EvCutLabel::Zem); + } + + registry.fill(HIST("zPos"), collision.posZ()); + registry.fill(HIST("T0Ccent"), collision.centFT0C()); + + // Nch-based selection + int glbTracks = 0; + for (const auto& track : tracks) { + // Track Selection + // if (track.hasITS()) { itsTracks++; } + if (!track.isGlobalTrack()) { + continue; + } + if ((track.pt() < minPt) || (track.pt() > maxPt)) { + continue; + } + registry.fill(HIST("ZposVsEta"), collision.posZ(), track.eta()); + registry.fill(HIST("EtaVsPhi"), track.eta(), track.phi()); + registry.fill(HIST("sigma1Pt"), track.pt(), track.sigma1Pt()); + registry.fill(HIST("dcaXYvspT"), track.dcaXY(), track.pt()); + glbTracks++; + } + + bool skipEvent{false}; + if (useMidRapNchSel) { + auto hMeanNch = ccdb->getForTimeStamp(paTHmeanNch.value, foundBC.timestamp()); + auto hSigmaNch = ccdb->getForTimeStamp(paTHsigmaNch.value, foundBC.timestamp()); + if (!hMeanNch) { + LOGF(info, "hMeanNch NOT LOADED!"); + return; + } + if (!hSigmaNch) { + LOGF(info, "hSigmaNch NOT LOADED!"); + return; + } + + const int binT0M{hMeanNch->FindBin(normT0M)}; + const double meanNch{hMeanNch->GetBinContent(binT0M)}; + const double sigmaNch{hSigmaNch->GetBinContent(binT0M)}; + const double nSigmaSelection{nSigmaNchCut * sigmaNch}; + const double diffMeanNch{meanNch - glbTracks}; + + if (!(std::abs(diffMeanNch) < nSigmaSelection)) { + registry.fill(HIST("ExcludedEvtVsFT0M"), normT0M); + registry.fill(HIST("ExcludedEvtVsNch"), glbTracks); + } else { + skipEvent = true; + } + } + + // Skip event based on number of Nch sigmas + if (!skipEvent) { + return; + } + + auto efficiency = ccdb->getForTimeStamp(paTHEff.value, foundBC.timestamp()); + if (!efficiency) { + return; + } + + auto feedDown = ccdb->getForTimeStamp(paTHFD.value, foundBC.timestamp()); + if (!feedDown) { + return; + } + + //--------------------------------------------------- + + uint64_t timeStamp{foundBC.timestamp()}; + + TRandom3 rndGen(timeStamp); + std::vector vPoisson; + for (int replica = 0; replica < kSizeBootStrapEnsemble; ++replica) { + vPoisson.emplace_back(rndGen.Poisson(1.)); + } + + for (int replica = 0; replica < kSizeBootStrapEnsemble; ++replica) { + + hPoisson[replica]->Fill(vPoisson.at(replica)); + + for (uint64_t evtRep = 0; evtRep < vPoisson.at(replica); ++evtRep) { + + double nchMult{0.}; + std::vector pTs; + std::vector vecFD; + std::vector vecEff; + + // Calculates the Nch multiplicity + for (const auto& track : tracks) { + // Track Selection + if (!track.isGlobalTrack()) { + continue; + } + if ((track.pt() < minPt) || (track.pt() > maxPt)) { + continue; + } + + float pt{track.pt()}; + int foundNchBin{efficiency->GetXaxis()->FindBin(glbTracks)}; + int foundPtBin{efficiency->GetYaxis()->FindBin(pt)}; + float effValue{1.}; + float fdValue{1.}; + if (applyEff) { + effValue = efficiency->GetBinContent(foundNchBin, foundPtBin); + } + if (applyFD) { + fdValue = feedDown->GetBinContent(foundNchBin, foundPtBin); + } + if ((effValue > 0.) && (fdValue > 0.)) { + nchMult += (std::pow(effValue, -1.) * fdValue); + } + } + + if (!applyEff) + nchMult = static_cast(glbTracks); + if (applyEff && !correctNch) + nchMult = static_cast(glbTracks); + if (nchMult < minNchSel) { + return; + } + + // Fill vectors for [pT] measurement + pTs.clear(); + vecFD.clear(); + vecEff.clear(); + for (const auto& track : tracks) { + // Track Selection + if (!track.isGlobalTrack()) { + continue; + } + if ((track.pt() < minPt) || (track.pt() > maxPtSpectra)) { + continue; + } + + float pt{track.pt()}; + int foundNchBin{efficiency->GetXaxis()->FindBin(glbTracks)}; + int foundPtBin{efficiency->GetYaxis()->FindBin(pt)}; + float effValue{1.}; + float fdValue{1.}; + if (applyEff) { + effValue = efficiency->GetBinContent(foundNchBin, foundPtBin); + fdValue = feedDown->GetBinContent(foundNchBin, foundPtBin); + } + if (applyEff && !applyFD) { + fdValue = 1.0; + } + if ((effValue > 0.) && (fdValue > 0.)) { + pTs.emplace_back(pt); + vecEff.emplace_back(effValue); + vecFD.emplace_back(fdValue); + } + } + + double p1, p2, p3, p4, w1, w2, w3, w4; + p1 = p2 = p3 = p4 = w1 = w2 = w3 = w4 = 0.0; + getPTpowers(pTs, vecEff, vecFD, p1, w1, p2, w2, p3, w3, p4, w4); + + // EbE one-particle pT correlation + double oneParCorr{p1 / w1}; + + // EbE two-particle pT correlation + double denTwoParCorr{std::pow(w1, 2.) - w2}; + double numTwoParCorr{std::pow(p1, 2.) - p2}; + double twoParCorr{numTwoParCorr / denTwoParCorr}; + + // EbE three-particle pT correlation + double denThreeParCorr{std::pow(w1, 3.) - 3. * w2 * w1 + 2. * w3}; + double numThreeParCorr{std::pow(p1, 3.) - 3. * p2 * p1 + 2. * p3}; + double threeParCorr{numThreeParCorr / denThreeParCorr}; + + // EbE four-particle pT correlation + double denFourParCorr{std::pow(w1, 4.) - 6. * w2 * std::pow(w1, 2.) + 3. * std::pow(w2, 2.) + 8 * w3 * w1 - 6. * w4}; + double numFourParCorr{std::pow(p1, 4.) - 6. * p2 * std::pow(p1, 2.) + 3. * std::pow(p2, 2.) + 8 * p3 * p1 - 6. * p4}; + double fourParCorr{numFourParCorr / denFourParCorr}; + + hNch[replica]->Fill(nchMult); + pNchVsOneParCorr[replica]->Fill(nchMult, oneParCorr, w1); + pNchVsOneParCorrVsZN[replica]->Fill(nchMult, sumZNs, oneParCorr, w1); + pNchVsTwoParCorrVsZN[replica]->Fill(nchMult, sumZNs, twoParCorr, denTwoParCorr); + pNchVsThreeParCorrVsZN[replica]->Fill(nchMult, sumZNs, threeParCorr, denThreeParCorr); + pNchVsFourParCorrVsZN[replica]->Fill(nchMult, sumZNs, fourParCorr, denFourParCorr); + } + } + } + PROCESS_SWITCH(UccZdc, processEventSampling, "Process Event Sampling 4 Bootstrap", true); + // Preslice perMCCollision = aod::mcparticle::mcCollisionId; Preslice perCollision = aod::track::collisionId; Service pdg; From 56e5302f152667311eab909383b8d705a87c8a67 Mon Sep 17 00:00:00 2001 From: Omar Vazquez Date: Wed, 16 Jul 2025 12:17:33 -0600 Subject: [PATCH 2/2] Use configureables in QA process function --- PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx | 36 +++++++++----------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx b/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx index 75db937ed13..86b12e219cc 100644 --- a/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx @@ -195,11 +195,11 @@ struct UccZdc { registry.add("zPos", ";;Entries;", kTH1F, {axisZpos}); registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent}); - registry.add("NchUncorrected", ";#it{N}_{ch} (|#eta| < 0.8);Entries;", kTH1F, {{300, 0., 3000.}}); + registry.add("NchUncorrected", ";#it{N}_{ch} (|#eta| < 0.8);Entries;", kTH1F, {{nBinsNch, minNch, maxNch}}); registry.add("hEventCounter", ";;Events", kTH1F, {axisEvent}); registry.add("ZNamp", ";ZNA+ZNC;Entries;", kTH1F, {{nBinsZN, -0.5, maxZN}}); registry.add("ExcludedEvtVsFT0M", ";T0A+T0C (#times 1/100, -3.3 < #eta < -2.1 and 3.5 < #eta < 4.9);Entries;", kTH1F, {{nBinsAmpFT0, 0., maxAmpFT0}}); - registry.add("ExcludedEvtVsNch", ";#it{N}_{ch} (|#eta|<0.8);Entries;", kTH1F, {{300, 0, 3000}}); + registry.add("ExcludedEvtVsNch", ";#it{N}_{ch} (|#eta|<0.8);Entries;", kTH1F, {{nBinsNch, minNch, maxNch}}); registry.add("Nch", ";#it{N}_{ch} (|#eta| < 0.8, Corrected);", kTH1F, {{nBinsNch, minNch, maxNch}}); registry.add("NchVsOneParCorr", ";#it{N}_{ch} (|#eta| < 0.8, Corrected);#LT[#it{p}_{T}^{(1)}]#GT (GeV/#it{c})", kTProfile, {{nBinsNch, minNch, maxNch}}); registry.add("EtaVsPhi", ";#eta;#varphi", kTH2F, {{{axisEta}, {100, -0.1 * PI, +2.1 * PI}}}); @@ -299,24 +299,24 @@ struct UccZdc { if (doprocessQA) { registry.add("Debunch", ";t_{ZDC}-t_{ZDA};t_{ZDC}+t_{ZDA}", kTH2F, {{{nBinsTDC, minTdc, maxTdc}, {nBinsTDC, minTdc, maxTdc}}}); registry.add("NchVsFT0M", ";T0A+T0C (#times 1/100, -3.3 < #eta < -2.1 and 3.5 < #eta < 4.9);#it{N}_{ch} (|#eta|<0.8);", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsNch, minNch, maxNch}}}); - registry.add("NchVsFT0A", ";T0A (#times 1/100, 3.5 < #eta < 4.9);#it{N}_{ch} (|#eta|<0.8);", kTH2F, {{{80, 0., 1800.}, {nBinsNch, minNch, maxNch}}}); - registry.add("NchVsFT0C", ";T0C (#times 1/100, -3.3 < #eta < -2.1);#it{N}_{ch} (|#eta|<0.8);", kTH2F, {{{80, 0., 600.}, {nBinsNch, minNch, maxNch}}}); + registry.add("NchVsFT0A", ";T0A (#times 1/100, 3.5 < #eta < 4.9);#it{N}_{ch} (|#eta|<0.8);", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsNch, minNch, maxNch}}}); + registry.add("NchVsFT0C", ";T0C (#times 1/100, -3.3 < #eta < -2.1);#it{N}_{ch} (|#eta|<0.8);", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsNch, minNch, maxNch}}}); registry.add("NchVsFV0A", ";V0A (#times 1/100, 2.2 < #eta < 5);#it{N}_{ch} (|#eta|<0.8);", kTH2F, {{{80, 0., maxAmpFV0}, {nBinsNch, minNch, maxNch}}}); registry.add("NchVsEt", ";#it{E}_{T} (|#eta|<0.8);#LTITS+TPC tracks#GT (|#eta|<0.8);", kTH2F, {{{nBinsNch, minNch, maxNch}, {nBinsNch, minNch, maxNch}}}); - registry.add("NchVsNPV", ";#it{N}_{PV} (|#eta|<1);ITS+TPC tracks (|#eta|<0.8);", kTH2F, {{{300, -0.5, 5999.5}, {nBinsNch, minNch, maxNch}}}); - registry.add("NchVsITStracks", ";ITS tracks nCls >= 5;TITS+TPC tracks (|#eta|<0.8);", kTH2F, {{{300, -0.5, 5999.5}, {nBinsNch, minNch, maxNch}}}); - registry.add("ZNVsFT0A", ";T0A (#times 1/100);ZNA+ZNC;", kTH2F, {{{80, 0., 1800.}, {nBinsZN, -0.5, maxZN}}}); - registry.add("ZNVsFT0C", ";T0C (#times 1/100);ZNA+ZNC;", kTH2F, {{{80, 0., 600.}, {nBinsZN, -0.5, maxZN}}}); + registry.add("NchVsNPV", ";#it{N}_{PV} (|#eta|<1);ITS+TPC tracks (|#eta|<0.8);", kTH2F, {{{nBinsITSTrack, minITSTrack, maxITSTrack}, {nBinsNch, minNch, maxNch}}}); + registry.add("NchVsITStracks", ";ITS tracks nCls >= 5;TITS+TPC tracks (|#eta|<0.8);", kTH2F, {{{nBinsITSTrack, minITSTrack, maxITSTrack}, {nBinsNch, minNch, maxNch}}}); + registry.add("ZNVsFT0A", ";T0A (#times 1/100);ZNA+ZNC;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsZN, -0.5, maxZN}}}); + registry.add("ZNVsFT0C", ";T0C (#times 1/100);ZNA+ZNC;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsZN, -0.5, maxZN}}}); registry.add("ZNVsFT0M", ";T0A+T0C (#times 1/100);ZNA+ZNC;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsZN, -0.5, maxZN}}}); registry.add("ZNAamp", ";ZNA;Entries;", kTH1F, {{nBinsZN, -0.5, maxZN}}); registry.add("ZPAamp", ";ZPA;Entries;", kTH1F, {{nBinsZP, -0.5, maxZP}}); registry.add("ZNCamp", ";ZNC;Entries;", kTH1F, {{nBinsZN, -0.5, maxZN}}); registry.add("ZPCamp", ";ZPC;Entries;", kTH1F, {{nBinsZP, -0.5, maxZP}}); - registry.add("ZNAVsZNC", ";ZNC;ZNA", kTH2F, {{{30, -0.5, maxZN}, {30, -0.5, maxZN}}}); - registry.add("ZPAVsZPC", ";ZPC;ZPA;", kTH2F, {{{100, -0.5, maxZP}, {100, -0.5, maxZP}}}); - registry.add("ZNAVsZPA", ";ZPA;ZNA;", kTH2F, {{{20, -0.5, maxZP}, {30, -0.5, maxZN}}}); - registry.add("ZNCVsZPC", ";ZPC;ZNC;", kTH2F, {{{20, -0.5, maxZP}, {30, -0.5, maxZN}}}); - registry.add("ZNVsZEM", ";ZEM;ZNA+ZNC;", kTH2F, {{{60, -0.5, maxZEM}, {60, -0.5, maxZN}}}); + registry.add("ZNAVsZNC", ";ZNC;ZNA", kTH2F, {{{nBinsZN, -0.5, maxZN}, {nBinsZN, -0.5, maxZN}}}); + registry.add("ZPAVsZPC", ";ZPC;ZPA;", kTH2F, {{{nBinsZP, -0.5, maxZP}, {nBinsZP, -0.5, maxZP}}}); + registry.add("ZNAVsZPA", ";ZPA;ZNA;", kTH2F, {{{nBinsZP, -0.5, maxZP}, {nBinsZN, -0.5, maxZN}}}); + registry.add("ZNCVsZPC", ";ZPC;ZNC;", kTH2F, {{{nBinsZP, -0.5, maxZP}, {nBinsZN, -0.5, maxZN}}}); + registry.add("ZNVsZEM", ";ZEM;ZNA+ZNC;", kTH2F, {{{nBinsZN, -0.5, maxZEM}, {nBinsZN, -0.5, maxZN}}}); registry.add("ZNCVsNch", ";#it{N}_{ch} (|#eta|<0.8);ZNC;", kTH2F, {{{nBinsNch, minNch, maxNch}, {nBinsZN, minZN, maxZN}}}); registry.add("ZNAVsNch", ";#it{N}_{ch} (|#eta|<0.8);ZNA;", kTH2F, {{{nBinsNch, minNch, maxNch}, {nBinsZN, minZN, maxZN}}}); registry.add("ZNVsNch", ";#it{N}_{ch} (|#eta|<0.8);ZNA+ZNC;", kTH2F, {{{nBinsNch, minNch, maxNch}, {nBinsZN, minZN, maxZN}}}); @@ -464,7 +464,6 @@ struct UccZdc { return; } registry.fill(HIST("hEventCounter"), EvCutLabel::TZero); - if (foundBC.has_fv0a()) { for (const auto& amplitude : foundBC.fv0a().amplitude()) { aV0A += amplitude; @@ -492,7 +491,6 @@ struct UccZdc { zpC /= kCollEnergy; float sumZNs{znA + znC}; float sumZEMs{aZEM1 + aZEM2}; - // TDC cut if (isTDCcut) { if (std::sqrt(std::pow(tZDCdif, 2.) + std::pow(tZDCsum, 2.)) > tdcCut) { @@ -543,15 +541,14 @@ struct UccZdc { const double nSigmaSelection{nSigmaNchCut * sigmaNch}; const double diffMeanNch{meanNch - glbTracks}; - if (!(std::abs(diffMeanNch) < nSigmaSelection)) { + if (std::abs(diffMeanNch) > nSigmaSelection) { registry.fill(HIST("ExcludedEvtVsFT0M"), normT0M); registry.fill(HIST("ExcludedEvtVsNch"), glbTracks); - } else { skipEvent = true; } } - if (!skipEvent) { + if (useMidRapNchSel && skipEvent) { return; } @@ -602,9 +599,8 @@ struct UccZdc { registry.fill(HIST("ZNCVsNch"), glbTracks, znC); registry.fill(HIST("ZNVsNch"), glbTracks, sumZNs); registry.fill(HIST("ZNDifVsNch"), glbTracks, znA - znC); - if (glbTracks >= minNchSel) { + if (glbTracks >= minNchSel) registry.fill(HIST("NchVsOneParCorr"), glbTracks, meanpt / glbTracks); - } } PROCESS_SWITCH(UccZdc, processQA, "Process QA", true);