From 3b8c8892d19f2e798703f934d3f8a431e39d4650 Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Mon, 9 Jun 2025 16:44:02 +0800 Subject: [PATCH 1/6] sample --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 59aae4d6c86..5dfb2f1f711 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -98,6 +98,7 @@ struct FlowCorrelationsUpc { O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix") O2_DEFINE_CONFIGURABLE(cfgMinMult, int, 0, "Minimum multiplicity for collision") O2_DEFINE_CONFIGURABLE(cfgMaxMult, int, 10, "Maximum multiplicity for collision") + O2_DEFINE_CONFIGURABLE(cfgSampleSize, double, 10, "Sample size for mixed event") ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for histograms"}; ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; @@ -114,6 +115,7 @@ struct FlowCorrelationsUpc { ConfigurableAxis axisVertexEfficiency{"axisVertexEfficiency", {10, -10, 10}, "vertex axis for efficiency histograms"}; ConfigurableAxis axisEtaEfficiency{"axisEtaEfficiency", {20, -1.0, 1.0}, "eta axis for efficiency histograms"}; ConfigurableAxis axisPtEfficiency{"axisPtEfficiency", {VARIABLE_WIDTH, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0}, "pt axis for efficiency histograms"}; + ConfigurableAxis axisSample{"axisSample", {cfgSampleSize, 0, cfgSampleSize}, "sample axis for histograms"}; // Added UPC Cuts SGSelector sgSelector; @@ -149,11 +151,11 @@ struct FlowCorrelationsUpc { registry.add("Nch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}}); registry.add("zVtx", "zVtx", {HistType::kTH1D, {axisVertex}}); - registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisMultiplicity, axisVertex, axisPtTrigger}}}); + registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); registry.add("eventcount", "bin", {HistType::kTH1F, {{3, 0, 3, "bin"}}}); // histogram to see how many events are in the same and mixed event - std::vector corrAxis = {{axisMultiplicity, "Nch"}, + std::vector corrAxis = {{axisSample, "Sample"}, {axisVertex, "z-vtx (cm)"}, {axisPtTrigger, "p_{T} (GeV/c)"}, {axisPtAssoc, "p_{T} (GeV/c)"}, @@ -192,11 +194,14 @@ struct FlowCorrelationsUpc { template void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { + + int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); + // loop over all tracks for (auto const& track1 : tracks1) { if (system == SameEvent) { - registry.fill(HIST("Trig_hist"), Nch, posZ, track1.pt()); + registry.fill(HIST("Trig_hist"), fSampleIndex, posZ, track1.pt()); } for (auto const& track2 : tracks2) { @@ -213,10 +218,10 @@ struct FlowCorrelationsUpc { // fill the right sparse and histograms if (system == SameEvent) { - same->getPairHist()->Fill(step, Nch, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta); + same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta); registry.fill(HIST("deltaEta_deltaPhi_same"), deltaPhi, deltaEta); } else if (system == MixedEvent) { - mixed->getPairHist()->Fill(step, Nch, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta); + mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta); registry.fill(HIST("deltaEta_deltaPhi_mixed"), deltaPhi, deltaEta); } } From 71753cd0ccf6a1e2b8d657827e6854cd325788f2 Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Mon, 9 Jun 2025 17:05:03 +0800 Subject: [PATCH 2/6] add include --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 5dfb2f1f711..1baf6b39759 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -14,6 +14,7 @@ /// \author Mingrui Zhao (mingrui.zhao@cern.ch, mingrui.zhao@mail.labz0.org) /// copied from Thor Jensen (thor.kjaersgaard.jensen@cern.ch) and Debojit Sarkar (debojit.sarkar@cern.ch) +#include"TRandom3.h" #include #include "Framework/runDataProcessing.h" From bfb092e930bee4249701130e3b90522af7552c84 Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Mon, 9 Jun 2025 17:13:34 +0800 Subject: [PATCH 3/6] clangformat --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 1baf6b39759..4bb7ec99b75 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -14,7 +14,7 @@ /// \author Mingrui Zhao (mingrui.zhao@cern.ch, mingrui.zhao@mail.labz0.org) /// copied from Thor Jensen (thor.kjaersgaard.jensen@cern.ch) and Debojit Sarkar (debojit.sarkar@cern.ch) -#include"TRandom3.h" +#include "TRandom3.h" #include #include "Framework/runDataProcessing.h" @@ -196,7 +196,7 @@ struct FlowCorrelationsUpc { void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { - int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); + int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); // loop over all tracks for (auto const& track1 : tracks1) { From ee6b5ff7a91b38c6b0720a938b1478a3e3a54efe Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Tue, 10 Jun 2025 20:31:05 +0800 Subject: [PATCH 4/6] Nch to cent --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 4bb7ec99b75..91c65bde921 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -193,7 +193,7 @@ struct FlowCorrelationsUpc { } template - void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float cent) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); From 43467e429988c10129e6535b9170d1c073a73d4c Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Thu, 12 Jun 2025 20:44:46 +0800 Subject: [PATCH 5/6] remove cent --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 91c65bde921..dbbfbcf58af 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -193,7 +193,7 @@ struct FlowCorrelationsUpc { } template - void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float cent) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); From 3d476dbf11d76b41d902280ec0c33e5d2f178fc6 Mon Sep 17 00:00:00 2001 From: miedema-11 <1260971129@qq.com> Date: Fri, 13 Jun 2025 14:04:17 +0800 Subject: [PATCH 6/6] modify calling function --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index dbbfbcf58af..13140698c20 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -253,7 +253,7 @@ struct FlowCorrelationsUpc { registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin fillYield(collision, tracks); - fillCorrelations(tracks, tracks, collision.posZ(), SameEvent, tracks.size()); // fill the SE histogram and Sparse + fillCorrelations(tracks, tracks, collision.posZ(), SameEvent); // fill the SE histogram and Sparse } PROCESS_SWITCH(FlowCorrelationsUpc, processSame, "Process same event", true); @@ -271,7 +271,7 @@ struct FlowCorrelationsUpc { for (auto const& [collision1, tracks1, collision2, tracks2] : pairs) { registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin - fillCorrelations(tracks1, tracks2, collision1.posZ(), MixedEvent, tracks1.size()); + fillCorrelations(tracks1, tracks2, collision1.posZ(), MixedEvent); } } PROCESS_SWITCH(FlowCorrelationsUpc, processMixed, "Process mixed events", true);