Skip to content

Commit 7aed372

Browse files
authored
Fix o2 linter errors
Refactor logging and constants in zdcExtraTableReader. Replaced std::cerr logging with LOGF for error handling and updated constant names for consistency.
1 parent 2faab54 commit 7aed372

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Common/Tasks/zdcExtraTableReader.cxx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include <TMath.h>
4141
#include <TProfile3D.h>
4242

43-
#include <iostream>
4443
#include <memory>
4544
#include <string>
4645
#include <unordered_map>
@@ -168,8 +167,7 @@ TProfile3D* gCurrentShiftProfileZNC;
168167
double getMeanQFromMap(THn* h, double cent, double vx, double vy, double vz)
169168
{
170169
if (!h) {
171-
// Commented out to reduce log spam in case of missing maps, enable for debugging
172-
// std::cerr << "[MeanQ] Null THn pointer (cent=" << cent << ", vx=" << vx << ", vy=" << vy << ", vz=" << vz << ")" << std::endl;
170+
// LOGF(error, "[MeanQ] Null THn pointer");
173171
return 0.0;
174172
}
175173

@@ -179,7 +177,7 @@ double getMeanQFromMap(THn* h, double cent, double vx, double vy, double vz)
179177
TAxis* axVz = h->GetAxis(3);
180178

181179
if (!axCent || !axVx || !axVy || !axVz) {
182-
std::cerr << "[MeanQ] One of THn axes is null" << std::endl;
180+
LOGF(error, "[MeanQ] One of THn axes is null");
183181
return 0.0;
184182
}
185183

@@ -883,10 +881,10 @@ struct ZdcExtraTableReader {
883881

884882
// DEBUG: Print only if shift is actually happening for first few events
885883
static int debugPrintCount = 0;
886-
constexpr int maxDebugPrints = 10;
887-
constexpr double psiTolerance = 1e-6;
884+
constexpr int MaxDebugPrints = 10;
885+
constexpr double PsiTolerance = 1e-6;
888886

889-
if (debugPrintCount < maxDebugPrints && std::abs(deltaPsi) > psiTolerance) {
887+
if (debugPrintCount < MaxDebugPrints && std::abs(deltaPsi) > PsiTolerance) {
890888
LOGF(info, "ZNA Shift: Cent %.1f, Raw %.3f (Delta %.4f)", cent, psiZNA, deltaPsi);
891889
debugPrintCount++;
892890
}

0 commit comments

Comments
 (0)