diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx index eb16b83f315..d20a78429dd 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx @@ -100,7 +100,8 @@ struct upcPhotonuclearAnalysisJMG { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Declare configurables on events/collisions - Configurable nEvenstMixed{"nEvenstMixed", 3, {"Events to be Mixed"}}; + Configurable nEventsMixed{"nEventsMixed", 3, {"Events to be Mixed"}}; + Configurable factorEventsMixed{"factorEventsMixed", 100, {"factorEventsMixed to events mixed"}}; Configurable myZVtxCut{"myZVtxCut", 10., {"My collision cut"}}; Configurable myTimeZNACut{"myTimeZNACut", 2., {"My collision cut"}}; Configurable myTimeZNCCut{"myTimeZNCCut", 2., {"My collision cut"}}; @@ -275,23 +276,18 @@ struct upcPhotonuclearAnalysisJMG { mixedGapSideC.setObject(new CorrelationContainer("mixedEventGapSideC", "mixedEventGapSideC", corrAxis, effAxis, {})); } - std::vector vtxBinsEdges{VARIABLE_WIDTH, -10.0f, -5.0f, 0.0f, 5.0f, 10.0f}; + std::vector vtxBinsEdges{VARIABLE_WIDTH, -10.0f, -7.0f, -5.0f, -2.5f, 0.0f, 2.5f, 5.0f, 7.0f, 10.0f}; std::vector gapSideBinsEdges{VARIABLE_WIDTH, -0.5, 0.5, 1.5}; SliceCache cache; + int countGapA = 0; + int countGapC = 0; // Binning only on PosZ without multiplicity // using BinningType = ColumnBinningPolicy; using BinningType = ColumnBinningPolicy; - BinningType bindingOnVtx{{vtxBinsEdges, {gapSideBinsEdges}}, true}; - SameKindPair pairs{bindingOnVtx, nEvenstMixed, -1, &cache}; - - // ColumnBinningPolicy bindingOnVtx{{vtxBinsEdges, multBinsEdges}, true}; - - // SameKindPair, - // FullUDTracks, - // ColumnBinningPolicy> - // pair{bindingOnVtx, 5, -1, &cache}; + BinningType bindingOnVtx{{vtxBinsEdges, gapSideBinsEdges}, true}; + SameKindPair pairs{bindingOnVtx, nEventsMixed, -1, &cache}; template bool isCollisionCutSG(CSG const& collision, int SideGap) @@ -584,7 +580,8 @@ struct upcPhotonuclearAnalysisJMG { if (fillCollisionUD(sameGapSideC, multiplicity) == false) { return; } - // LOGF(debug, "Filling sameGapSideC events"); + histos.fill(HIST("eventcount"), -1); + // LOGF(info, "Filling sameGapSideC events"); fillCorrelationsUD(sameGapSideC, reconstructedTracks, reconstructedTracks, multiplicity, reconstructedCollision.posZ()); break; default: @@ -601,18 +598,34 @@ struct upcPhotonuclearAnalysisJMG { // int sgSide = reconstructedCollision.gapSide(); // int sgSide = 0; + int maxCountGapA = 0; + int maxCountGapC = 0; + + if (auto histEventCount = histos.get(HIST("eventcount"))) { + int binA = histEventCount->GetXaxis()->FindBin(-2); // Gap A + int binC = histEventCount->GetXaxis()->FindBin(-1); // Gap C + + maxCountGapA = histEventCount->GetBinContent(binA) * factorEventsMixed; + maxCountGapC = histEventCount->GetBinContent(binC) * factorEventsMixed; + } + for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { if (collision1.size() == 0 || collision2.size() == 0) { - // LOGF(debug, "One or both collisions are empty."); + // LOGF(info, "One or both collisions are empty."); continue; } + if (countGapA >= maxCountGapA && countGapC >= maxCountGapC) { + break; + } float multiplicity = 0; if (collision1.gapSide() == 0 && collision2.gapSide() == 0) { // gap on side A if (isCollisionCutSG(collision1, 0) == false && isCollisionCutSG(collision2, 0) == false) { continue; } - // LOGF(debug, "In the pairs loop, gap side A"); + // std::cout << "Counts for Gap A: " << countGapA << " Maximum Count for Gap A " << maxCountGapA << std::endl; + ++countGapA; + // LOGF(info, "In the pairs loop, gap side A"); multiplicity = tracks1.size(); if (fillCollisionUD(mixedGapSideA, multiplicity) == false) { return; @@ -620,20 +633,22 @@ struct upcPhotonuclearAnalysisJMG { // histos.fill(HIST("eventcount"), bindingOnVtx.getBin({collision1.posZ()})); histos.fill(HIST("eventcount"), bindingOnVtx.getBin({collision1.posZ(), collision1.gapSide()})); fillCorrelationsUD(mixedGapSideA, tracks1, tracks2, multiplicity, collision1.posZ()); - // LOGF(debug, "Filling mixedGapSideA events, Gap for side A"); + // LOGF(info, "Filling mixedGapSideA events, Gap for side A"); } if (collision1.gapSide() == 1 && collision2.gapSide() == 1) { // gap on side C if (isCollisionCutSG(collision1, 1) == false && isCollisionCutSG(collision2, 1) == false) { continue; } - // LOGF(debug, "In the pairs loop, gap side C"); + // std::cout << "Counts for Gap C: " << countGapC << " Maximum Count for Gap C" << maxCountGapC << std::endl; + ++countGapC; + // LOGF(info, "In the pairs loop, gap side C"); multiplicity = tracks1.size(); if (fillCollisionUD(mixedGapSideC, multiplicity) == false) { return; } fillCorrelationsUD(mixedGapSideC, tracks1, tracks2, multiplicity, collision1.posZ()); - // LOGF(debug, "Filling mixedGapSideC events, Gap for side C"); + // LOGF(info, "Filling mixedGapSideC events, Gap for side C"); } else { continue; }