Skip to content

Commit ef72ddb

Browse files
committed
Code checker fixes
1 parent a4f2057 commit ef72ddb

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

ALICE3/Core/TrackUtilities.cxx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ void o2::upgrade::convertTLorentzVectorToO2Track(const int charge,
3333
const std::vector<double>& productionVertex,
3434
o2::track::TrackParCov& o2track)
3535
{
36-
std::array<float, 5> params;
36+
std::array<float, 5> params = {0.};
3737
std::array<float, 15> covm = {0.};
38-
float s, c, x;
38+
float s{}, c{}, x{};
3939
o2::math_utils::sincos(static_cast<float>(particle.Phi()), s, c);
4040
o2::math_utils::rotateZInv(static_cast<float>(productionVertex[0]), static_cast<float>(productionVertex[1]), x, params[0], s, c);
4141
params[1] = static_cast<float>(productionVertex[2]);
@@ -61,16 +61,14 @@ float o2::upgrade::computeTrackLength(const o2::track::TrackParCov& track, const
6161
float length = -100;
6262

6363
o2::math_utils::CircleXYf_t trcCircle;
64-
float sna, csa;
64+
float sna{}, csa{};
6565
track.getCircleParams(magneticField, trcCircle, sna, csa);
6666

6767
// distance between circle centers (one circle is at origin -> easy)
6868
const float centerDistance = std::hypot(trcCircle.xC, trcCircle.yC);
6969

7070
// condition of circles touching - if not satisfied returned length will be -100
7171
if (centerDistance < trcCircle.rC + radius && centerDistance > std::fabs(trcCircle.rC - radius)) {
72-
length = 0.0f;
73-
7472
// base radical direction
7573
const float ux = trcCircle.xC / centerDistance;
7674
const float uy = trcCircle.yC / centerDistance;
@@ -87,17 +85,17 @@ float o2::upgrade::computeTrackLength(const o2::track::TrackParCov& track, const
8785
(centerDistance + trcCircle.rC + radius));
8886

8987
// possible intercept points of track and TOF layer in 2D plane
90-
const float point1[2] = {radical * ux + displace * vx, radical * uy + displace * vy};
91-
const float point2[2] = {radical * ux - displace * vx, radical * uy - displace * vy};
88+
const std::array<float, 2> point1 = {radical * ux + displace * vx, radical * uy + displace * vy};
89+
const std::array<float, 2> point2 = {radical * ux - displace * vx, radical * uy - displace * vy};
9290

9391
// decide on correct intercept point
94-
std::array<float, 3> mom;
92+
std::array<float, 3> mom{};
9593
track.getPxPyPzGlo(mom);
9694
const float scalarProduct1 = point1[0] * mom[0] + point1[1] * mom[1];
9795
const float scalarProduct2 = point2[0] * mom[0] + point2[1] * mom[1];
9896

9997
// get start point
100-
std::array<float, 3> startPoint;
98+
std::array<float, 3> startPoint{};
10199
track.getXYZGlo(startPoint);
102100

103101
float cosAngle = -1000, modulus = -1000;

0 commit comments

Comments
 (0)