From 297dd8d4e6bce40be1e4f5af195174e9e134edfb Mon Sep 17 00:00:00 2001 From: Pengchong Hu Date: Sun, 28 Jun 2026 19:15:16 +0200 Subject: [PATCH 1/2] correction of weightsfile --- .../Tasks/multiharmonicCorrelations.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx index 163d2ba19d6..e3811035a6e 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx @@ -419,7 +419,6 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to return; } // Print current run number: - // LOGF(info, "Run number: %d", collision.bc().runNumber()); int currentRun = collision.bc().runNumber(); auto it = phih.histMap.find(currentRun); auto histweight = wh.weightsmap.find(currentRun); @@ -532,8 +531,14 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to it->second->Fill(phi); } - if (cfUseWeights && histweight != wh.weightsmap.end()) - weight = histweight->second->GetBinContent(histweight->second->FindBin(phi)); + if (cfUseWeights){ + if (histweight != wh.weightsmap.end() && histweight->second) + weight = histweight->second->GetBinContent(histweight->second->FindBin(phi)); + else{ + LOG(warning) << "No weights found for run " << currentRun << ", using weight=1"; + weight = 1; + } + } else weight = 1; @@ -573,9 +578,9 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to float wFour = Four(0, 0, 0, 0).Re(); float four32 = Four(3, 2, -3, -2).Re() / wFour; float four42 = Four(4, 2, -4, -2).Re() / wFour; - float v22 = Two(2, -2) / wTwo; - float v32 = Two(3, -3) / wTwo; - float v42 = Two(4, -4) / wTwo; + float v22 = Two(2, -2).Re() / wTwo; + float v32 = Two(3, -3).Re() / wTwo; + float v42 = Two(4, -4).Re() / wTwo; if (std::isnan(v22) || std::isnan(v32) || std::isnan(v42) || std::isnan(four32) || std::isnan(four42)) { LOGF(info, "\033[1;31m%s std::isnan(v22) || std::isnan(v32) || std::isnan(v42) || std::isnan(four32) || std::isnan(four42)\033[0m", __FUNCTION__); LOGF(error, "v22 = %f\nv32 = %f\nv42 = %f\nfour32=%f\nv42 = %f\n", v22, v32, v42, four32, four42); @@ -802,6 +807,7 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to LOG(fatal) << "Failed to load weights for run " << run; return; } + histweights->SetName(Form("histWithEfficiencyCorrections_%d", run)); wh.fWeightsHistList->Add(histweights); wh.weightsmap[run] = histweights; } From 683cead92942b36a0ebf75041ef7dade34560575 Mon Sep 17 00:00:00 2001 From: Pengchong Hu Date: Sun, 28 Jun 2026 19:23:11 +0200 Subject: [PATCH 2/2] fix for clang-format --- .../Tasks/multiharmonicCorrelations.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx index e3811035a6e..2b247f42258 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx @@ -531,16 +531,16 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to it->second->Fill(phi); } - if (cfUseWeights){ - if (histweight != wh.weightsmap.end() && histweight->second) + if (cfUseWeights) { + if (histweight != wh.weightsmap.end() && histweight->second) { weight = histweight->second->GetBinContent(histweight->second->FindBin(phi)); - else{ + } else { LOG(warning) << "No weights found for run " << currentRun << ", using weight=1"; weight = 1; } - } - else + } else { weight = 1; + } // ... and corresponding MC truth simulated: // See https://github.com/AliceO2Group/O2Physics/blob/master/Tutorials/src/mcHistograms.cxx