Skip to content

Commit 4808c9d

Browse files
victor-gonzalezVictor
and
Victor
authored
[PWGCF] DptDpt - Improve load corrections logs when issues (AliceO2Group#8873)
Co-authored-by: Victor <[email protected]>
1 parent cc69240 commit 4808c9d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

PWGCF/Tasks/dptdptcorrelations.cxx

+18-18
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ struct DptDptCorrelationsTask {
300300
{
301301
using namespace correlationstask;
302302

303-
LOGF(info, "Stored NUA&NUE corrections for %d track ids", corrs.size());
303+
LOGF(info, "Storing NUA&NUE corrections for %d track ids", corrs.size());
304304
for (uint i = 0; i < corrs.size(); ++i) {
305305
if (corrs[i] != nullptr) {
306306
if (nNoOfDimensions != corrs[i]->GetDimension()) {
307-
LOGF(fatal, " Corrections receved dimensions %d for track id %d different than expected %d", corrs[i]->GetDimension(), i, nNoOfDimensions);
307+
LOGF(fatal, " Corrections received dimensions %d for track id %d different than expected %d", corrs[i]->GetDimension(), i, nNoOfDimensions);
308308
} else {
309309
LOGF(info, " Storing NUA&NUE corrections %s for track id %d with %d dimensions %s",
310310
corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, nNoOfDimensions, corrs[i] != nullptr ? "yes" : "no");
@@ -332,7 +332,7 @@ struct DptDptCorrelationsTask {
332332
}
333333
}
334334
}
335-
LOGF(info, "Average NUA&NUE correction for track id %d: %f", i, avg / nbins);
335+
LOGF(info, " Average NUA&NUE correction for track id %d: %f", i, avg / nbins);
336336
}
337337
}
338338
ccdbstored = true;
@@ -1201,7 +1201,7 @@ struct DptDptCorrelationsTask {
12011201
{
12021202
using namespace correlationstask;
12031203

1204-
static constexpr std::string_view kStrDim[] = {"", "2D", "3D", "4D"};
1204+
static constexpr std::string_view kStrDim[] = {"", "", "2D", "3D", "4D"};
12051205
return kStrDim[nNoOfDimensions].data();
12061206
}
12071207

@@ -1255,13 +1255,13 @@ struct DptDptCorrelationsTask {
12551255
} else {
12561256
std::vector<TH1*> corrs{tnames.size(), nullptr};
12571257
for (uint isp = 0; isp < tnames.size(); ++isp) {
1258-
corrs[isp] = reinterpret_cast<TH1*>(ccdblst->FindObject(
1259-
TString::Format("correction%s_%02d-%02d_%s",
1260-
getDimensionStr(),
1261-
static_cast<int>(fCentMultMin[ixDCE]),
1262-
static_cast<int>(fCentMultMax[ixDCE]),
1263-
tnames[isp].c_str())
1264-
.Data()));
1258+
auto hName = TString::Format("correction%s_%02d-%02d_%s", getDimensionStr(), static_cast<int>(fCentMultMin[ixDCE]), static_cast<int>(fCentMultMax[ixDCE]), tnames[isp].c_str());
1259+
corrs[isp] = reinterpret_cast<TH1*>(ccdblst->FindObject(hName.Data()));
1260+
if (corrs[isp] != nullptr) {
1261+
LOGF(info, "Loaded %s", corrs[isp]->GetName());
1262+
} else {
1263+
LOGF(warning, "No correction histogram for species %d with name %s", isp, hName.Data());
1264+
}
12651265
}
12661266
storeTrackCorrections(corrs);
12671267
std::vector<TH2*> ptavgs{tnames.size(), nullptr};
@@ -1330,13 +1330,13 @@ struct DptDptCorrelationsTask {
13301330
} else {
13311331
std::vector<TH1*> corrs{tnames.size(), nullptr};
13321332
for (uint isp = 0; isp < tnames.size(); ++isp) {
1333-
corrs[isp] = reinterpret_cast<TH1*>(ccdblst->FindObject(
1334-
TString::Format("correction%s_%02d-%02d_%s",
1335-
getDimensionStr(),
1336-
static_cast<int>(fCentMultMin[ixDCE]),
1337-
static_cast<int>(fCentMultMax[ixDCE]),
1338-
tnames[isp].c_str())
1339-
.Data()));
1333+
auto hName = TString::Format("correction%s_%02d-%02d_%s", getDimensionStr(), static_cast<int>(fCentMultMin[ixDCE]), static_cast<int>(fCentMultMax[ixDCE]), tnames[isp].c_str());
1334+
corrs[isp] = reinterpret_cast<TH1*>(ccdblst->FindObject(hName.Data()));
1335+
if (corrs[isp] != nullptr) {
1336+
LOGF(info, "Loaded %s", corrs[isp]->GetName());
1337+
} else {
1338+
LOGF(warning, "No correction histogram for species %d with name %s", isp, hName.Data());
1339+
}
13401340
}
13411341
dataCEME[ixDCE]->storeTrackCorrections(corrs);
13421342
std::vector<TH2*> ptavgs{tnames.size(), nullptr};

0 commit comments

Comments
 (0)