Skip to content

Commit b1a9c7e

Browse files
authored
Refactor zdcExtraTableProducer
Fix O2Physics-code-check errors
1 parent 4a5d030 commit b1a9c7e

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

Common/TableProducer/zdcExtraTableProducer.cxx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
#include <TH1.h>
3333
#include <TH2.h>
3434
#include <TRandom3.h>
35+
#include <Rtypes.h>
3536

3637
#include <cmath>
3738
#include <cstdint>
39+
#include <array>
3840

3941
using namespace o2;
4042
using namespace o2::framework;
@@ -125,10 +127,10 @@ struct ZdcExtraTableProducer {
125127
}
126128

127129
template <typename TCollision>
128-
uint8_t eventSelected(TCollision collision)
130+
uint8_t eventSelected(TCollision const& collision)
129131
{
130132
uint8_t selectionBits = 0;
131-
bool selected;
133+
bool selected = false;
132134

133135
registry.fill(HIST("hEventCount"), AllEvents);
134136

@@ -253,8 +255,8 @@ struct ZdcExtraTableProducer {
253255
//
254256
double sumZNC = 0;
255257
double sumZNA = 0;
256-
double pmqZNC[4] = {};
257-
double pmqZNA[4] = {};
258+
std::array<double, 4> pmqZNC = {};
259+
std::array<double, 4> pmqZNA = {};
258260
//
259261
if (isZNChit) {
260262
for (int it = 0; it < NTowers; it++) {
@@ -292,8 +294,8 @@ struct ZdcExtraTableProducer {
292294
constexpr float kBeamEne = 5.36 * 0.5;
293295

294296
// Provide coordinates of centroid over ZN (side C) front face
295-
constexpr float X[4] = {-1.75, 1.75, -1.75, 1.75};
296-
constexpr float Y[4] = {-1.75, -1.75, 1.75, 1.75};
297+
constexpr std::array<float, 4> X = {-1.75, 1.75, -1.75, 1.75};
298+
constexpr std::array<float, 4> Y = {-1.75, -1.75, 1.75, 1.75};
297299
constexpr float kAlpha = 0.395; // saturation correction
298300

299301
float numXZNC = 0., numYZNC = 0., denZNC = 0.;
@@ -328,7 +330,8 @@ struct ZdcExtraTableProducer {
328330
znaCommon = sumZNA;
329331
}
330332

331-
float centroidZNC[2], centroidZNA[2];
333+
std::array<float, 2> centroidZNC = {};
334+
std::array<float, 2> centroidZNA = {};
332335

333336
if (denZNC != 0.) {
334337
float cZNC = 1.0;

0 commit comments

Comments
 (0)