From ed3338aa281a040f6888a31921edaf4b37ca23f5 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Mon, 16 Nov 2026 21:42:19 +0100 Subject: [PATCH 1/2] Add Energy info of zdc with correlation with azimuth --- .../Common/zdc2stagecalibration.cxx | 245 +++++++++++++++++- 1 file changed, 231 insertions(+), 14 deletions(-) diff --git a/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx b/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx index 16b85a16ffe..94875581197 100644 --- a/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx +++ b/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -46,6 +47,7 @@ #include #include #include +#include using namespace o2; using namespace o2::framework; @@ -88,8 +90,11 @@ struct zdc2stagecalibration { Configurable confQTwistPath{"confQTwistPath", "", "CCDB path to the run-wise Q-twist map"}; Configurable useQShift{"useQShift", false, "apply ZDC azimuthal shift correction after twist"}; Configurable confQShiftPath{"confQShiftPath", "", "CCDB path to the run-wise Q-shift Fourier map"}; + Configurable deriveSingleNeutronResponse{"deriveSingleNeutronResponse", false, "store gain-corrected raw signals and spatial-map snapshot for offline superposition"}; + Configurable cfgSingleNeutronRawEnergyMax{"cfgSingleNeutronRawEnergyMax", 0.f, "optional upper raw-energy limit for joint sparse storage; zero disables the limit"}; + Configurable deriveEnergyResponse{"deriveEnergyResponse", false, "collect ZDC-only energy-position moments before Q recentering on the selected event sample"}; Configurable deriveQResponse{"deriveQResponse", false, "collect TPC-ZDC response moments after recentering"}; - Configurable useQResponse{"useQResponse", false, "apply approved run-wise diagonal Q response after recentering"}; + Configurable useQResponse{"useQResponse", false, "apply approved run-wise Q response after recentering"}; Configurable confQResponsePath{"confQResponsePath", "Users/s/skundu/ZDC/QResponse_1percent", "CCDB path for the 1-percent Q response map"}; Configurable cfgQResponseCentMin{"cfgQResponseCentMin", 10, "lower centrality edge of approved response application range"}; Configurable cfgQResponseCentMax{"cfgQResponseCentMax", 40, "upper centrality edge of approved response application range"}; @@ -118,6 +123,7 @@ struct zdc2stagecalibration { TH2D* qShiftProfile = nullptr; TH2D* qResponseMap = nullptr; + static constexpr double kSingleNeutronRawEnergyAxisMax = 500.; static constexpr int kQRecenteringNFeatures = 21; static constexpr int kQRecenteringNMatrixMoments = kQRecenteringNFeatures * (kQRecenteringNFeatures + 1) / 2; static constexpr int kQRecenteringNComponents = 4; @@ -158,6 +164,17 @@ struct zdc2stagecalibration { !(cfgTPCResponsePtMin.value >= 0.f && cfgTPCResponsePtMax.value > cfgTPCResponsePtMin.value && cfgTPCResponseEtaMax.value > 0.f))) { LOGF(fatal, "Response derivation requires stage 2, Structured71 recentering, response/twist/shift disabled and valid TPC track selection"); } + if (deriveSingleNeutronResponse.value && + (calibrationStage.value != 2 || !useGainCallib.value || !useSpatialCalib.value || + !useQRecentering.value || qRecenteringMethod.value != 4 || useQResponse.value || + useQTwist.value || useQShift.value || usecfactor.value || !std::isfinite(cfgSingleNeutronRawEnergyMax.value) || + cfgSingleNeutronRawEnergyMax.value < 0.f || cfgSpatialCalibBins.value <= 0)) { + LOGF(fatal, "Single-neutron response requires stage 2 with gain, spatial and Structured71, no c factor/response/twist/shift, and nonnegative raw-energy storage limit"); + } + if (deriveEnergyResponse.value && (calibrationStage.value != 2 || !useQRecentering.value || qRecenteringMethod.value != 4 || + useQResponse.value || useQTwist.value || useQShift.value)) { + LOGF(fatal, "Energy response derivation requires stage 2, Structured71 recentering, and response/twist/shift disabled"); + } if (useQResponse.value && (calibrationStage.value != 2 || !useQRecentering.value || qRecenteringMethod.value != 4 || useQTwist.value || useQShift.value || confQResponsePath.value.empty() || cfgQResponseCentMin.value < 0 || cfgQResponseCentMax.value > 80 || @@ -189,6 +206,57 @@ struct zdc2stagecalibration { histos.add("TPCResponseQA/pMomentsEtaNeg", "Raw TPC Q1/Q2 vs recentered ZDC (negative eta);centrality (%);moment index;", kTProfile2D, {responseCentAxis, responseMomentAxis}); } + if (deriveSingleNeutronResponse.value) { + // Store the native AO2D energy; the 1n peak and energy unit are not assumed. + // Variable-width raw-energy bins give approximately 0.5% relative precision. + std::vector energyEdges{0., 0.1}; + while (energyEdges.back() * 1.005 < kSingleNeutronRawEnergyAxisMax) { + energyEdges.push_back(energyEdges.back() * 1.005); + } + energyEdges.push_back(kSingleNeutronRawEnergyAxisMax); + const AxisSpec rawEnergyAxis{energyEdges, "E_{common} (native AO2D units)"}; + const AxisSpec fracAxis = {400, 0., 2., "T_{i}/E_{common} (gain corrected)"}; + histos.add("SingleNeutronQA/hSignalsRawA", "Joint raw-energy signals A", kTHnSparseD, {rawEnergyAxis, fracAxis, fracAxis, fracAxis, fracAxis}); + histos.add("SingleNeutronQA/hSignalsRawC", "Joint raw-energy signals C", kTHnSparseD, {rawEnergyAxis, fracAxis, fracAxis, fracAxis, fracAxis}); + histos.add("SingleNeutronQA/hEnergyRawVsCentA", "All selected ZNA energies (native units)", kTH2D, {centralityAxis, rawEnergyAxis}); + histos.add("SingleNeutronQA/hEnergyRawVsCentC", "All selected ZNC energies (native units)", kTH2D, {centralityAxis, rawEnergyAxis}); + histos.add("SingleNeutronQA/hSpatialSnapshot", "Sum of spatial-map snapshots", kTH3D, {spatialCalibAxis, spatialCalibAxis, {8, 0., 8., "tower A1..A4,C1..C4"}}); + histos.add("SingleNeutronQA/hSpatialSnapshotSquared", "Sum of squared spatial-map snapshots", kTH3D, {spatialCalibAxis, spatialCalibAxis, {8, 0., 8., "tower A1..A4,C1..C4"}}); + histos.add("SingleNeutronQA/hMetadata", "Snapshot count, run, run squared, raw-energy schema version, alpha", kTH1D, {{5, 0., 5.}}); + histos.add("SingleNeutronQA/hLibraryStatus", "A eligible raw energy, A stored, C eligible raw energy, C stored", kTH1D, {{4, 0., 4.}}); + } + if (deriveEnergyResponse.value) { + const AxisSpec energyMomentAxis = {46, 0., 46., "moment index"}; + // Same ordering for the physical linear-energy centroid and the actual pre-recentering Q. + histos.add("EnergyResponseQA/pMomentsA", "ZNA common energy vs actual raw Q;centrality (%);moment;", kTProfile2D, {centralityAxis, energyMomentAxis}); + histos.add("EnergyResponseQA/pMomentsC", "ZNC common energy vs actual raw Q;centrality (%);moment;", kTProfile2D, {centralityAxis, energyMomentAxis}); + histos.add("EnergyResponseQA/pPhysicalMomentsA", "ZNA common energy vs linear-energy centroid;centrality (%);moment;", kTProfile2D, {centralityAxis, energyMomentAxis}); + histos.add("EnergyResponseQA/pPhysicalMomentsC", "ZNC common energy vs linear-energy centroid;centrality (%);moment;", kTProfile2D, {centralityAxis, energyMomentAxis}); + const std::array fNames{"1", "x", "y", "x2", "y2", "xy"}; + auto label = [&](auto profile) { + int bin = 1; + for (int i = 0; i < 6; ++i) + for (int j = i; j < 6; ++j) { + profile->GetYaxis()->SetBinLabel(bin++, (std::string("f_") + fNames[i] + "*f_" + fNames[j]).c_str()); + } + for (int i = 0; i < 6; ++i) + profile->GetYaxis()->SetBinLabel(bin++, (std::string("E*") + fNames[i]).c_str()); + profile->GetYaxis()->SetBinLabel(bin++, "E2"); + profile->GetYaxis()->SetBinLabel(bin++, "E"); + for (int n = 1; n <= 4; ++n) { + const std::string k = std::to_string(n); + profile->GetYaxis()->SetBinLabel(bin++, ("cos" + k).c_str()); + profile->GetYaxis()->SetBinLabel(bin++, ("sin" + k).c_str()); + profile->GetYaxis()->SetBinLabel(bin++, ("Ecos" + k).c_str()); + profile->GetYaxis()->SetBinLabel(bin++, ("Esin" + k).c_str()); + } + profile->GetYaxis()->SetBinLabel(bin++, "E_nonzeroQ"); + }; + label(histos.get(HIST("EnergyResponseQA/pMomentsA"))); + label(histos.get(HIST("EnergyResponseQA/pMomentsC"))); + label(histos.get(HIST("EnergyResponseQA/pPhysicalMomentsA"))); + label(histos.get(HIST("EnergyResponseQA/pPhysicalMomentsC"))); + } AxisSpec resolutionCentralityAxis = {50, 0.0, 50.0, "centrality (%)"}; AxisSpec resolutionVzAxis = {20, -10.0, 10.0, "v_{z} (cm)"}; AxisSpec vertexXYAxis = {100, -0.1, 0.1, "vertex x/y (cm)"}; @@ -379,6 +447,8 @@ struct zdc2stagecalibration { if (useQResponse.value) { const AxisSpec scaleAxis = {4, 0., 4., "Ax,Ay,Cx,Cy"}; histos.add("QResponseQA/pAppliedScalesVsCentrality", "Actual applied response factors;centrality (%);component;", kTProfile2D, {centralityAxis, scaleAxis}); + const AxisSpec matrixAxis = {8, 0., 8., "Axx,Axy,Ayx,Ayy,Cxx,Cxy,Cyx,Cyy"}; + histos.add("QResponseQA/pAppliedMatrixVsCentrality", "Applied response matrix;centrality (%);matrix element;", kTProfile2D, {centralityAxis, matrixAxis}); histos.add("QResponseQA/hAppliedVsCentrality", "Events with response correction;centrality (%)", kTH1F, {centralityAxis}); } ccdb->setURL(cfgCcdbParam.cfgURL); @@ -417,6 +487,43 @@ struct zdc2stagecalibration { LOGF(warn, "No ZDC spatial calibration found for run %d at timestamp %llu", runNumber, timestamp); } } + if (deriveSingleNeutronResponse.value) { + const int nb = cfgSpatialCalibBins.value; + auto checkAxis = [](const TAxis* ax, int n, double low, double high) { + if (ax->GetNbins() != n) { + return false; + } + for (int i = 1; i <= n + 1; ++i) { + if (std::abs(ax->GetBinLowEdge(i) - (low + (high - low) * (i - 1) / n)) > 1.e-8) { + return false; + } + } + return true; + }; + if (!spatialprofile || !checkAxis(spatialprofile->GetXaxis(), nb, -1., 1.) || + !checkAxis(spatialprofile->GetYaxis(), nb, -1., 1.) || + !checkAxis(spatialprofile->GetZaxis(), 8, 0., 8.)) { + LOGF(fatal, "Cannot snapshot spatial map: check cfgSpatialCalibBins and axis definition"); + } + for (int ix = 1; ix <= nb; ++ix) { + for (int iy = 1; iy <= nb; ++iy) { + for (int iz = 1; iz <= 8; ++iz) { + const double content = spatialprofile->GetBinContent(ix, iy, iz); + const double value = std::isfinite(content) && content > 0. ? content : 0.; + // A nonpositive factor remains invalid after replay. + histos.fill(HIST("SingleNeutronQA/hSpatialSnapshot"), spatialprofile->GetXaxis()->GetBinCenter(ix), + spatialprofile->GetYaxis()->GetBinCenter(iy), iz - 0.5, value); + histos.fill(HIST("SingleNeutronQA/hSpatialSnapshotSquared"), spatialprofile->GetXaxis()->GetBinCenter(ix), + spatialprofile->GetYaxis()->GetBinCenter(iy), iz - 0.5, value * value); + } + } + } + histos.fill(HIST("SingleNeutronQA/hMetadata"), 0.5, 1.); + histos.fill(HIST("SingleNeutronQA/hMetadata"), 1.5, static_cast(runNumber)); + histos.fill(HIST("SingleNeutronQA/hMetadata"), 2.5, static_cast(runNumber) * runNumber); + histos.fill(HIST("SingleNeutronQA/hMetadata"), 3.5, 3.); + histos.fill(HIST("SingleNeutronQA/hMetadata"), 4.5, followpub.value ? 0.395 : 1.); + } if (calibrationStage.value == 2 && useQRecentering.value) { const std::string qRecenteringPath = qRecenteringMethod.value == 4 ? confQRecenteringStructured71Path.value : (qRecenteringMethod.value == 1 ? confQRecenteringMultidimPath.value : confQRecenteringPath.value); if (!qRecenteringPath.empty()) { @@ -435,13 +542,16 @@ struct zdc2stagecalibration { } if (useQResponse.value) { qResponseMap = ccdb->getForTimeStamp(confQResponsePath.value, timestamp); - if (!qResponseMap || qResponseMap->GetNbinsX() != 80 || qResponseMap->GetNbinsY() != 5 || + if (!qResponseMap || qResponseMap->GetNbinsX() != 80 || (qResponseMap->GetNbinsY() != 5 && qResponseMap->GetNbinsY() != 9) || qResponseMap->GetXaxis()->GetXmin() != 0. || qResponseMap->GetXaxis()->GetXmax() != 80.) { LOGF(fatal, "Missing or invalid 1-percent response map for run %d", runNumber); } const std::array labels{"ScaleAx", "ScaleAy", "ScaleCx", "ScaleCy", "Approved"}; - for (int j = 0; j < 5; ++j) { - if (std::string(qResponseMap->GetYaxis()->GetBinLabel(j + 1)) != labels[j]) { + const std::array matrixLabels{"Axx", "Axy", "Ayx", "Ayy", "Cxx", "Cxy", "Cyx", "Cyy", "Approved"}; + const bool matrixMap = qResponseMap->GetNbinsY() == 9; + const int approvalBin = matrixMap ? 9 : 5; + for (int j = 0; j < approvalBin; ++j) { + if (std::string(qResponseMap->GetYaxis()->GetBinLabel(j + 1)) != (matrixMap ? matrixLabels[j] : labels[j])) { LOGF(fatal, "Wrong Q response map component ordering for run %d", runNumber); } } @@ -454,13 +564,25 @@ struct zdc2stagecalibration { } if (i <= cfgQResponseCentMin.value || i > cfgQResponseCentMax.value) continue; - if (qResponseMap->GetBinContent(i, 5) != 1.) { + if (qResponseMap->GetBinContent(i, approvalBin) != 1.) { LOGF(fatal, "Unapproved response map bin %d for run %d", i, runNumber); } - for (int j = 1; j <= 4; ++j) { - const double scale = qResponseMap->GetBinContent(i, j); - if (!std::isfinite(scale) || scale <= 0.) { - LOGF(fatal, "Invalid response factor in bin %d for run %d", i, runNumber); + if (matrixMap) { + for (int side = 0; side < 2; ++side) { + const int j = 4 * side + 1; + const double xx = qResponseMap->GetBinContent(i, j), xy = qResponseMap->GetBinContent(i, j + 1); + const double yx = qResponseMap->GetBinContent(i, j + 2), yy = qResponseMap->GetBinContent(i, j + 3); + if (!std::isfinite(xx) || !std::isfinite(xy) || !std::isfinite(yx) || !std::isfinite(yy) || + xx <= 0. || yy <= 0. || xx * yy - xy * yx <= 0. || std::abs(xy - yx) > 1.e-10) { + LOGF(fatal, "Invalid symmetric response matrix in bin %d for run %d", i, runNumber); + } + } + } else { + for (int j = 1; j <= 4; ++j) { + const double scale = qResponseMap->GetBinContent(i, j); + if (!std::isfinite(scale) || scale <= 0.) { + LOGF(fatal, "Invalid response factor in bin %d for run %d", i, runNumber); + } } } } @@ -600,6 +722,36 @@ struct zdc2stagecalibration { using ResponseTracks = o2::soa::Join; + // 46 direct common-PMT energy profile moments; angular moments use only nonzero vectors. + template + static void fillEnergyResponseMoments(Fill fill, double qx, double qy, double energy) + { + if (!std::isfinite(qx) || !std::isfinite(qy) || !std::isfinite(energy) || energy <= 0.) + return; + const std::array f{1., qx, qy, qx * qx, qy * qy, qx * qy}; + int k = 0; + for (int i = 0; i < 6; ++i) + for (int j = i; j < 6; ++j) + fill(k++, f[i] * f[j]); + for (double v : f) + fill(k++, v * energy); + fill(k++, energy * energy); + fill(k++, energy); + if (std::hypot(qx, qy) > 0.) { + const double phi = std::atan2(qy, qx); + for (int n = 1; n <= 4; ++n) { + const double c = std::cos(n * phi), t = std::sin(n * phi); + fill(k++, c); + fill(k++, t); + fill(k++, energy * c); + fill(k++, energy * t); + } + fill(k++, energy); + } else { + k += 17; + } + } + void fillTPCResponseMoments(ResponseTracks const& tracks, const std::array& qValues, float centrality) { @@ -873,6 +1025,9 @@ struct zdc2stagecalibration { } } + // Save the input to the nonlinear spatial lookup for offline signal addition. + const auto znaGainOnly = znaCorr; + const auto zncGainOnly = zncCorr; bool spatialOK = true; if (calibrationStage.value == 2 && useSpatialCalib.value) { if (!spatialprofile) { @@ -1233,6 +1388,52 @@ struct zdc2stagecalibration { histos.fill(HIST("QCorrelationQA/pQACorrelationAfterVsCentrality"), centrality, 2.5, qValues[0] * qValues[3]); histos.fill(HIST("QCorrelationQA/pQACorrelationAfterVsCentrality"), centrality, 3.5, qValues[1] * qValues[2]); + if (deriveSingleNeutronResponse.value) { + const double eA = znaEnergycommon; + const double eC = zncEnergycommon; + if (std::isfinite(eA)) { + histos.fill(HIST("SingleNeutronQA/hEnergyRawVsCentA"), centrality, eA); + } + if (std::isfinite(eC)) { + histos.fill(HIST("SingleNeutronQA/hEnergyRawVsCentC"), centrality, eC); + } + const auto eligible = [&](double e) { + return std::isfinite(e) && e > 0. && e < kSingleNeutronRawEnergyAxisMax && + (cfgSingleNeutronRawEnergyMax.value == 0.f || e < cfgSingleNeutronRawEnergyMax.value); + }; + const auto validFractions = [](const std::array& t, double e) { + for (double v : t) { + if (!std::isfinite(v) || v <= 0. || v / e >= 2.) { + return false; + } + } + return true; + }; + if (eligible(eA)) { + histos.fill(HIST("SingleNeutronQA/hLibraryStatus"), 0.5); + if (validFractions(znaGainOnly, eA)) { + histos.fill(HIST("SingleNeutronQA/hSignalsRawA"), eA, znaGainOnly[0] / eA, + znaGainOnly[1] / eA, znaGainOnly[2] / eA, znaGainOnly[3] / eA); + histos.fill(HIST("SingleNeutronQA/hLibraryStatus"), 1.5); + } + } + if (eligible(eC)) { + histos.fill(HIST("SingleNeutronQA/hLibraryStatus"), 2.5); + if (validFractions(zncGainOnly, eC)) { + histos.fill(HIST("SingleNeutronQA/hSignalsRawC"), eC, zncGainOnly[0] / eC, + zncGainOnly[1] / eC, zncGainOnly[2] / eC, zncGainOnly[3] / eC); + histos.fill(HIST("SingleNeutronQA/hLibraryStatus"), 3.5); + } + } + } + // Energy maps must use fixed detector coordinates, not the time/vertex-recentered coordinates. + // Fill only here, so successful recentering and the existing ZDC selection are common to all QA. + if (deriveEnergyResponse.value) { + fillEnergyResponseMoments([&](int k, double v) { histos.fill(HIST("EnergyResponseQA/pMomentsA"), centrality, k + 0.5, v); }, qxZDCA, qyZDCA, znaEnergycommon); + fillEnergyResponseMoments([&](int k, double v) { histos.fill(HIST("EnergyResponseQA/pMomentsC"), centrality, k + 0.5, v); }, qxZDCC, qyZDCC, zncEnergycommon); + fillEnergyResponseMoments([&](int k, double v) { histos.fill(HIST("EnergyResponseQA/pPhysicalMomentsA"), centrality, k + 0.5, v); }, centroidXA, centroidYA, znaEnergycommon); + fillEnergyResponseMoments([&](int k, double v) { histos.fill(HIST("EnergyResponseQA/pPhysicalMomentsC"), centrality, k + 0.5, v); }, centroidXC, centroidYC, zncEnergycommon); + } // Response derivation always uses the recentered, unscaled Q vectors. if (deriveQResponse.value) { fillTPCResponseMoments(tracks, qValues, centrality); @@ -1267,13 +1468,29 @@ struct zdc2stagecalibration { if (centBin < 1 || centBin > qResponseMap->GetNbinsX()) { LOGF(fatal, "Invalid response centrality bin for run %d", runNumber); } - for (int j = 0; j < 4; ++j) { - const double scale = qResponseMap->GetBinContent(centBin, j + 1); - qValues[j] *= scale; - if (!std::isfinite(qValues[j]) || !std::isfinite(static_cast(qValues[j]))) { + if (qResponseMap->GetNbinsY() == 9) { + for (int side = 0; side < 2; ++side) { + const int j = 4 * side, k = 2 * side; + const double xx = qResponseMap->GetBinContent(centBin, j + 1), xy = qResponseMap->GetBinContent(centBin, j + 2); + const double yx = qResponseMap->GetBinContent(centBin, j + 3), yy = qResponseMap->GetBinContent(centBin, j + 4); + const double qx = qValues[k], qy = qValues[k + 1]; + qValues[k] = xx * qx + xy * qy; + qValues[k + 1] = yx * qx + yy * qy; + const std::array elements{xx, xy, yx, yy}; + for (int i = 0; i < 4; ++i) + histos.fill(HIST("QResponseQA/pAppliedMatrixVsCentrality"), centrality, j + i + 0.5, elements[i]); + } + } else { + for (int j = 0; j < 4; ++j) { + const double scale = qResponseMap->GetBinContent(centBin, j + 1); + qValues[j] *= scale; + histos.fill(HIST("QResponseQA/pAppliedScalesVsCentrality"), centrality, j + 0.5, scale); + } + } + for (double q : qValues) { + if (!std::isfinite(q) || !std::isfinite(static_cast(q))) { LOGF(fatal, "Nonfinite Q after response correction, run %d bin %d", runNumber, centBin); } - histos.fill(HIST("QResponseQA/pAppliedScalesVsCentrality"), centrality, j + 0.5, scale); } histos.fill(HIST("QResponseQA/hAppliedVsCentrality"), centrality); } From a8b2880ba074d6184f72b27452a943898f1e5b14 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Mon, 16 Nov 2026 22:09:23 +0100 Subject: [PATCH 2/2] Update zdc2stagecalibration.cxx Fix unnecessary histogram pointer copy --- PWGLF/TableProducer/Common/zdc2stagecalibration.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx b/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx index 94875581197..1945bea3730 100644 --- a/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx +++ b/PWGLF/TableProducer/Common/zdc2stagecalibration.cxx @@ -233,7 +233,7 @@ struct zdc2stagecalibration { histos.add("EnergyResponseQA/pPhysicalMomentsA", "ZNA common energy vs linear-energy centroid;centrality (%);moment;", kTProfile2D, {centralityAxis, energyMomentAxis}); histos.add("EnergyResponseQA/pPhysicalMomentsC", "ZNC common energy vs linear-energy centroid;centrality (%);moment;", kTProfile2D, {centralityAxis, energyMomentAxis}); const std::array fNames{"1", "x", "y", "x2", "y2", "xy"}; - auto label = [&](auto profile) { + auto label = [&](const auto& profile) { int bin = 1; for (int i = 0; i < 6; ++i) for (int j = i; j < 6; ++j) {