Skip to content

Commit 4e75287

Browse files
committed
Fix linter errors
1 parent f8e7294 commit 4e75287

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed

Common/Core/EventPlaneHelper.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ void EventPlaneHelper::DoCorrections(float& qx, float& qy,
131131
qy = (qy - corrections[2] * qx) / (1.0 - corrections[3] * corrections[2]);
132132

133133
// Rescaling of the Qx-Qy into a circle.
134-
if (fabs(corrections[4]) > 1e-8) {
134+
if (std::fabs(corrections[4]) > 1e-8) {
135135
qx /= corrections[4];
136136
}
137-
if (fabs(corrections[5]) > 1e-8) {
137+
if (std::fabs(corrections[5]) > 1e-8) {
138138
qy /= corrections[5];
139139
}
140140
}
@@ -153,9 +153,9 @@ void EventPlaneHelper::DoTwist(float& qx, float& qy, float lp, float lm)
153153

154154
void EventPlaneHelper::DoRescale(float& qx, float& qy, float ap, float am)
155155
{
156-
if (fabs(ap) > 1e-8)
156+
if (std::fabs(ap) > 1e-8)
157157
qx /= ap;
158-
if (fabs(am) > 1e-8)
158+
if (std::fabs(am) > 1e-8)
159159
qy /= am;
160160
}
161161

Common/Core/PID/PIDTOF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ class ExpTimes
445445
static constexpr float mMassZSqared = mMassZ * mMassZ; /// (M/z)^2
446446

447447
/// Computes the expected time of a track, given it TOF expected momentum
448-
static float ComputeExpectedTime(const float tofExpMom, const float length) { return length * sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (o2::constants::physics::LightSpeedCm2PS * tofExpMom); }
448+
static float ComputeExpectedTime(const float tofExpMom, const float length) { return length * std::sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (o2::constants::physics::LightSpeedCm2PS * tofExpMom); }
449449

450450
/// Gets the expected signal of the track of interest under the PID assumption
451451
/// \param track Track of interest

Common/TableProducer/PID/pidBayes.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ struct bayesPid {
285285
// bethe = fTPCResponse.GetExpectedSignal(track, type, AliTPCPIDResponse::kdEdxDefault, fUseTPCEtaCorrection, fUseTPCMultiplicityCorrection, fUseTPCPileupCorrection);
286286
// sigma = fTPCResponse.GetExpectedSigma(track, type, AliTPCPIDResponse::kdEdxDefault, fUseTPCEtaCorrection, fUseTPCMultiplicityCorrection, fUseTPCPileupCorrection);
287287

288-
if (abs(dedx - bethe) > fRange * sigma) {
289-
// Probability[kTPC][pid] = exp(-0.5 * fRange * fRange) / sigma; // BUG fix
290-
Probability[kTPC][pid] = exp(-0.5 * fRange * fRange);
288+
if (std::abs(dedx - bethe) > fRange * sigma) {
289+
// Probability[kTPC][pid] = std::exp(-0.5 * fRange * fRange) / sigma; // BUG fix
290+
Probability[kTPC][pid] = std::exp(-0.5 * fRange * fRange);
291291
} else {
292-
// Probability[kTPC][pid] = exp(-0.5 * (dedx - bethe) * (dedx - bethe) / (sigma * sigma)) / sigma; //BUG fix
293-
Probability[kTPC][pid] = exp(-0.5 * (dedx - bethe) * (dedx - bethe) / (sigma * sigma));
292+
// Probability[kTPC][pid] = std::exp(-0.5 * (dedx - bethe) * (dedx - bethe) / (sigma * sigma)) / sigma; //BUG fix
293+
Probability[kTPC][pid] = std::exp(-0.5 * (dedx - bethe) * (dedx - bethe) / (sigma * sigma));
294294
mismatch = false;
295295
}
296296
if (Probability[kTPC][pid] <= 0.f) {
@@ -329,7 +329,7 @@ struct bayesPid {
329329
const float mismPropagationFactor[10] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
330330
// In the O2 this cannot be done because the cluster information is missing in the AOD
331331
// if (!fNoTOFmism) { // this flag allows to disable mismatch for iterative procedure to get prior probabilities
332-
// mismPropagationFactor[3] = 1 + exp(1 - 1.12 * pt); // it has to be aligned with the one in AliPIDCombined
332+
// mismPropagationFactor[3] = 1 + std::exp(1 - 1.12 * pt); // it has to be aligned with the one in AliPIDCombined
333333
// mismPropagationFactor[4] = 1 + 1. / (4.71114 - 5.72372 * pt + 2.94715 * pt * pt); // it has to be aligned with the one in AliPIDCombined
334334

335335
// int nTOFcluster = 0;
@@ -343,10 +343,10 @@ struct bayesPid {
343343
// nTOFcluster = 80;
344344
// break;
345345
// case kPPB: // pPb 5.05 ATeV
346-
// nTOFcluster = int(308 - 2.12 * fCurrCentrality + exp(4.917 - 0.1604 * fCurrCentrality));
346+
// nTOFcluster = int(308 - 2.12 * fCurrCentrality + std::exp(4.917 - 0.1604 * fCurrCentrality));
347347
// break;
348348
// case kPBPB: // PbPb 2.76 ATeV
349-
// nTOFcluster = int(exp(9.4 - 0.022 * fCurrCentrality));
349+
// nTOFcluster = int(std::exp(9.4 - 0.022 * fCurrCentrality));
350350
// break;
351351
// }
352352
// }
@@ -377,9 +377,9 @@ struct bayesPid {
377377
const float sig = /*responseTOFPID.GetExpectedSigma(Response[kTOF], track)*/ +0.f;
378378

379379
if (nsigmas < fTOFtail) {
380-
Probability[kTOF][pid] = exp(-0.5 * nsigmas * nsigmas) / sig;
380+
Probability[kTOF][pid] = std::exp(-0.5 * nsigmas * nsigmas) / sig;
381381
} else {
382-
Probability[kTOF][pid] = exp(-(nsigmas - fTOFtail * 0.5) * fTOFtail) / sig;
382+
Probability[kTOF][pid] = std::exp(-(nsigmas - fTOFtail * 0.5) * fTOFtail) / sig;
383383
}
384384

385385
Probability[kTOF][pid] += fgTOFmismatchProb * mismPropagationFactor[pid];
@@ -557,7 +557,7 @@ struct bayesPidQa {
557557
double lmin = TMath::Log10(min);
558558
double ldelta = (TMath::Log10(max) - lmin) / (static_cast<double>(kNBins));
559559
for (int i = 0; i < kNBins; i++) {
560-
binp[i] = exp(TMath::Log(10) * (lmin + i * ldelta));
560+
binp[i] = std::exp(TMath::Log(10) * (lmin + i * ldelta));
561561
}
562562
binp[kNBins] = max + 1;
563563
h->GetXaxis()->Set(kNBins, binp);

Common/TableProducer/PID/pidTOFBase.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ struct tofEventTime {
390390
evTimeTOF.removeBias<TrksEvTime::iterator, filterForTOFEventTime>(trk, nGoodTracksForTOF, et, erret, 2);
391391
}
392392
uint8_t flags = 0;
393-
if (erret < errDiamond && (maxEvTimeTOF <= 0.f || abs(et) < maxEvTimeTOF)) {
393+
if (erret < errDiamond && (maxEvTimeTOF <= 0.f || std::abs(et) < maxEvTimeTOF)) {
394394
flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF;
395395
} else {
396396
et = 0.f;
@@ -409,7 +409,7 @@ struct tofEventTime {
409409
///
410410
/// Process function to prepare the event for each track on Run 3 data with the FT0
411411
using EvTimeCollisionsFT0 = soa::Join<EvTimeCollisions, aod::FT0sCorrected>;
412-
void processFT0(TrksEvTime& tracks,
412+
void processFT0(TrksEvTime const& tracks,
413413
aod::FT0s const&,
414414
EvTimeCollisionsFT0 const&)
415415
{
@@ -465,7 +465,7 @@ struct tofEventTime {
465465
if constexpr (removeTOFEvTimeBias) {
466466
evTimeTOF.removeBias<TrksEvTime::iterator, filterForTOFEventTime>(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2);
467467
}
468-
if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || abs(t0TOF[0]) < maxEvTimeTOF)) {
468+
if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || std::abs(t0TOF[0]) < maxEvTimeTOF)) {
469469
flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF;
470470

471471
weight = 1.f / (t0TOF[1] * t0TOF[1]);
@@ -493,7 +493,7 @@ struct tofEventTime {
493493
} else {
494494
tableFlags(flags);
495495
}
496-
tableEvTime(eventTime / sumOfWeights, sqrt(1. / sumOfWeights));
496+
tableEvTime(eventTime / sumOfWeights, std::sqrt(1. / sumOfWeights));
497497
if (enableTableTOFOnly) {
498498
tableEvTimeTOFOnly((uint8_t)filterForTOFEventTime(trk), t0TOF[0], t0TOF[1], evTimeTOF.mEventTimeMultiplicity);
499499
}
@@ -504,7 +504,7 @@ struct tofEventTime {
504504

505505
///
506506
/// Process function to prepare the event for each track on Run 3 data with only the FT0
507-
void processOnlyFT0(TrksEvTime& tracks,
507+
void processOnlyFT0(TrksEvTime const& tracks,
508508
aod::FT0s const&,
509509
EvTimeCollisionsFT0 const&)
510510
{

Common/Tasks/propagatorQa.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ struct propagatorQa {
172172
if (d_bz_input > -990) {
173173
d_bz = d_bz_input;
174174
o2::parameters::GRPMagField grpmag;
175-
if (fabs(d_bz) > 1e-5) {
175+
if (std::fabs(d_bz) > 1e-5) {
176176
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
177177
}
178178
o2::base::Propagator::initFieldFromGRP(&grpmag);
@@ -212,7 +212,7 @@ struct propagatorQa {
212212
initCCDB(bc);
213213
std::array<float, 2> dcaInfo;
214214

215-
for (auto& track : tracks) {
215+
for (const auto& track : tracks) {
216216
if (track.tpcNClsFound() < minTPCClustersRequired)
217217
continue;
218218

@@ -298,7 +298,7 @@ struct propagatorQa {
298298
// determine if track was used in svertexer
299299
bool usedInSVertexer = false;
300300
bool lUsedByV0 = false, lUsedByCascade = false;
301-
for (auto& V0 : V0s) {
301+
for (const auto& V0 : V0s) {
302302
if (V0.posTrackId() == track.globalIndex()) {
303303
lUsedByV0 = true;
304304
break;
@@ -308,7 +308,7 @@ struct propagatorQa {
308308
break;
309309
}
310310
}
311-
for (auto& cascade : cascades) {
311+
for (const auto& cascade : cascades) {
312312
if (cascade.bachelorId() == track.globalIndex()) {
313313
lUsedByCascade = true;
314314
break;
@@ -332,7 +332,7 @@ struct propagatorQa {
332332
initCCDB(bc);
333333
std::array<float, 2> dcaInfo;
334334

335-
for (auto& track : tracks) {
335+
for (const auto& track : tracks) {
336336
if (track.tpcNClsFound() < minTPCClustersRequired)
337337
continue;
338338

@@ -414,7 +414,7 @@ struct propagatorQa {
414414
// determine if track was used in svertexer
415415
bool usedInSVertexer = false;
416416
bool lUsedByV0 = false, lUsedByCascade = false;
417-
for (auto& V0 : V0s) {
417+
for (const auto& V0 : V0s) {
418418
if (V0.posTrackId() == track.globalIndex()) {
419419
lUsedByV0 = true;
420420
break;
@@ -424,7 +424,7 @@ struct propagatorQa {
424424
break;
425425
}
426426
}
427-
for (auto& cascade : cascades) {
427+
for (const auto& cascade : cascades) {
428428
if (cascade.bachelorId() == track.globalIndex()) {
429429
lUsedByCascade = true;
430430
break;
@@ -448,7 +448,7 @@ struct propagatorQa {
448448
initCCDB(bc);
449449
std::array<float, 2> dcaInfo;
450450

451-
for (auto& trackIU : tracksIU) {
451+
for (const auto& trackIU : tracksIU) {
452452
if (trackIU.tpcNClsFound() < minTPCClustersRequired)
453453
continue; // skip if not enough TPC clusters
454454

Common/Tools/trackSelectionRequest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class trackSelectionRequest
9090
if (lTrack.eta() > maxEta)
9191
return false;
9292
// DCA to PV
93-
if (fabs(lTrack.dcaXY()) < maxDCAz)
93+
if (std::fabs(lTrack.dcaXY()) < maxDCAz)
9494
return false;
9595
// TracksExtra-based
9696
if (lTrack.hasTPC() == false && requireTPC)

0 commit comments

Comments
 (0)