Skip to content

Commit 614bf09

Browse files
authored
[DPG] abs -> std::abs in DPG tasks (#9400)
1 parent 8ad1847 commit 614bf09

File tree

9 files changed

+26
-22
lines changed

9 files changed

+26
-22
lines changed

DPG/Tasks/AOTTrack/PID/HMPID/qaHMPID.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ struct pidHmpidQa {
159159

160160
histos.fill(HIST("hmpidSignal"), t.hmpidSignal());
161161
histos.fill(HIST("PhivsEta"), t.track_as<TrackCandidates>().eta(), t.track_as<TrackCandidates>().phi());
162-
histos.fill(HIST("hmpidMomvsTrackMom"), t.track_as<TrackCandidates>().p(), abs(t.hmpidMom()));
163-
histos.fill(HIST("hmpidCkovvsMom"), abs(t.hmpidMom()), t.hmpidSignal());
162+
histos.fill(HIST("hmpidMomvsTrackMom"), t.track_as<TrackCandidates>().p(), std::abs(t.hmpidMom()));
163+
histos.fill(HIST("hmpidCkovvsMom"), std::abs(t.hmpidMom()), t.hmpidSignal());
164164
histos.fill(HIST("hmpidXTrack"), t.hmpidXTrack());
165165
histos.fill(HIST("hmpidYTrack"), t.hmpidYTrack());
166166
histos.fill(HIST("hmpidXMip"), t.hmpidXMip());
@@ -173,7 +173,7 @@ struct pidHmpidQa {
173173
histos.fill(HIST("hmpidQMip"), t.hmpidQMip());
174174
histos.fill(HIST("hmpidClusSize"), (t.hmpidClusSize() % 1000000) / 1000);
175175
histos.fill(HIST("TrackMom"), t.track_as<TrackCandidates>().p());
176-
histos.fill(HIST("hmpidMom"), abs(t.hmpidMom()));
176+
histos.fill(HIST("hmpidMom"), std::abs(t.hmpidMom()));
177177
for (int i = 0; i < 10; i++) {
178178
if (t.hmpidPhotsCharge()[i] > 0)
179179
histos.fill(HIST("hmpidPhotsCharge"), t.hmpidPhotsCharge()[i]);
@@ -190,7 +190,7 @@ struct pidHmpidQa {
190190
histos.fill(HIST("hmpidQMip0"), t.hmpidQMip());
191191
histos.fill(HIST("hmpidClusSize0"), (t.hmpidClusSize() % 1000000) / 1000);
192192
histos.fill(HIST("TrackMom0"), t.track_as<TrackCandidates>().p());
193-
histos.fill(HIST("hmpidMom0"), abs(t.hmpidMom()));
193+
histos.fill(HIST("hmpidMom0"), std::abs(t.hmpidMom()));
194194
for (int i = 0; i < 10; i++) {
195195
if (t.hmpidPhotsCharge()[i] > 0)
196196
histos.fill(HIST("hmpidPhotsCharge0"), t.hmpidPhotsCharge()[i]);
@@ -208,7 +208,7 @@ struct pidHmpidQa {
208208
histos.fill(HIST("hmpidQMip1"), t.hmpidQMip());
209209
histos.fill(HIST("hmpidClusSize1"), (t.hmpidClusSize() % 1000000) / 1000);
210210
histos.fill(HIST("TrackMom1"), t.track_as<TrackCandidates>().p());
211-
histos.fill(HIST("hmpidMom1"), abs(t.hmpidMom()));
211+
histos.fill(HIST("hmpidMom1"), std::abs(t.hmpidMom()));
212212
for (int i = 0; i < 10; i++) {
213213
if (t.hmpidPhotsCharge()[i] > 0)
214214
histos.fill(HIST("hmpidPhotsCharge1"), t.hmpidPhotsCharge()[i]);
@@ -226,7 +226,7 @@ struct pidHmpidQa {
226226
histos.fill(HIST("hmpidQMip2"), t.hmpidQMip());
227227
histos.fill(HIST("hmpidClusSize2"), (t.hmpidClusSize() % 1000000) / 1000);
228228
histos.fill(HIST("TrackMom2"), t.track_as<TrackCandidates>().p());
229-
histos.fill(HIST("hmpidMom2"), abs(t.hmpidMom()));
229+
histos.fill(HIST("hmpidMom2"), std::abs(t.hmpidMom()));
230230
for (int i = 0; i < 10; i++) {
231231
if (t.hmpidPhotsCharge()[i] > 0)
232232
histos.fill(HIST("hmpidPhotsCharge2"), t.hmpidPhotsCharge()[i]);
@@ -244,7 +244,7 @@ struct pidHmpidQa {
244244
histos.fill(HIST("hmpidQMip3"), t.hmpidQMip());
245245
histos.fill(HIST("hmpidClusSize3"), (t.hmpidClusSize() % 1000000) / 1000);
246246
histos.fill(HIST("TrackMom3"), t.track_as<TrackCandidates>().p());
247-
histos.fill(HIST("hmpidMom3"), abs(t.hmpidMom()));
247+
histos.fill(HIST("hmpidMom3"), std::abs(t.hmpidMom()));
248248
for (int i = 0; i < 10; i++) {
249249
if (t.hmpidPhotsCharge()[i] > 0)
250250
histos.fill(HIST("hmpidPhotsCharge3"), t.hmpidPhotsCharge()[i]);
@@ -262,7 +262,7 @@ struct pidHmpidQa {
262262
histos.fill(HIST("hmpidQMip4"), t.hmpidQMip());
263263
histos.fill(HIST("hmpidClusSize4"), (t.hmpidClusSize() % 1000000) / 1000);
264264
histos.fill(HIST("TrackMom4"), t.track_as<TrackCandidates>().p());
265-
histos.fill(HIST("hmpidMom4"), abs(t.hmpidMom()));
265+
histos.fill(HIST("hmpidMom4"), std::abs(t.hmpidMom()));
266266
for (int i = 0; i < 10; i++) {
267267
if (t.hmpidPhotsCharge()[i] > 0)
268268
histos.fill(HIST("hmpidPhotsCharge4"), t.hmpidPhotsCharge()[i]);
@@ -280,7 +280,7 @@ struct pidHmpidQa {
280280
histos.fill(HIST("hmpidQMip5"), t.hmpidQMip());
281281
histos.fill(HIST("hmpidClusSize5"), (t.hmpidClusSize() % 1000000) / 1000);
282282
histos.fill(HIST("TrackMom5"), t.track_as<TrackCandidates>().p());
283-
histos.fill(HIST("hmpidMom5"), abs(t.hmpidMom()));
283+
histos.fill(HIST("hmpidMom5"), std::abs(t.hmpidMom()));
284284
for (int i = 0; i < 10; i++) {
285285
if (t.hmpidPhotsCharge()[i] > 0)
286286
histos.fill(HIST("hmpidPhotsCharge5"), t.hmpidPhotsCharge()[i]);
@@ -298,7 +298,7 @@ struct pidHmpidQa {
298298
histos.fill(HIST("hmpidQMip6"), t.hmpidQMip());
299299
histos.fill(HIST("hmpidClusSize6"), (t.hmpidClusSize() % 1000000) / 1000);
300300
histos.fill(HIST("TrackMom6"), t.track_as<TrackCandidates>().p());
301-
histos.fill(HIST("hmpidMom6"), abs(t.hmpidMom()));
301+
histos.fill(HIST("hmpidMom6"), std::abs(t.hmpidMom()));
302302
for (int i = 0; i < 10; i++) {
303303
if (t.hmpidPhotsCharge()[i] > 0)
304304
histos.fill(HIST("hmpidPhotsCharge6"), t.hmpidPhotsCharge()[i]);

DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ struct tofPidBetaQa {
231231

232232
histos.fill(HIST("event/evsel"), 2);
233233

234-
if (abs(collision.posZ()) > 10.f) {
234+
if (std::abs(collision.posZ()) > 10.f) {
235235
return;
236236
}
237237

DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ struct tpcPidQa {
299299
histos.fill(HIST("event/evsel"), 2);
300300
}
301301

302-
if (abs(collision.posZ()) > 10.f) {
302+
if (std::abs(collision.posZ()) > 10.f) {
303303
return false;
304304
}
305305
if constexpr (fillHistograms) {
@@ -396,7 +396,7 @@ struct tpcPidQa {
396396
}
397397

398398
if (applyRapidityCut) {
399-
if (abs(t.rapidity(PID::getMass(id))) > 0.5) {
399+
if (std::abs(t.rapidity(PID::getMass(id))) > 0.5) {
400400
continue;
401401
}
402402
}

DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ struct tpcPidQaSignal {
219219
if (!t.has_collision()) {
220220
continue;
221221
}
222-
if (abs(t.collision().posZ()) > 10.f) {
222+
if (std::abs(t.collision().posZ()) > 10.f) {
223223
continue;
224224
}
225225
if (!isTrackSelected(t)) {
@@ -269,7 +269,7 @@ struct tpcPidQaSignal {
269269

270270
histos.fill(HIST("event/evsel"), 2);
271271

272-
if (abs(collision.posZ()) > 10.f) {
272+
if (std::abs(collision.posZ()) > 10.f) {
273273
return;
274274
}
275275
histos.fill(HIST("event/evsel"), 3);

DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12+
#include <string>
13+
1214
#include "Framework/runDataProcessing.h"
1315
#include "Framework/AnalysisTask.h"
1416
#include "Framework/AnalysisDataModel.h"
@@ -291,10 +293,10 @@ struct perfK0sResolution {
291293
if (!ntrack.hasTPC() || !ptrack.hasTPC()) {
292294
return false;
293295
}
294-
if (abs(ntrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
296+
if (std::abs(ntrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
295297
return false;
296298
}
297-
if (abs(ptrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
299+
if (std::abs(ptrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
298300
return false;
299301
}
300302
if (ntrack.tpcNClsCrossedRows() < extraCutTPCClusters || ptrack.tpcNClsCrossedRows() < extraCutTPCClusters) {

DPG/Tasks/AOTTrack/V0Cascades/qaLamMomResolution.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ struct qaLamMomResolution {
339339
return;
340340
}
341341
hist.fill(HIST("hEventSelectionFlow"), 1.f);
342-
if (collSelection && (abs(collision.posZ()) >= 10.)) {
342+
if (collSelection && (std::abs(collision.posZ()) >= 10.)) {
343343
return;
344344
}
345345
hist.fill(HIST("hEventSelectionFlow"), 2.f);

DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#include "qaEventTrack.h"
2121

22+
#include <vector>
23+
2224
#include "Framework/AnalysisTask.h"
2325
#include "Framework/HistogramRegistry.h"
2426
#include "Framework/runDataProcessing.h"
@@ -202,7 +204,7 @@ struct qaEventTrackLiteProducer {
202204
if (!isSelectedCollision(collision)) {
203205
return;
204206
}
205-
if (abs(collision.posZ()) > selectMaxVtxZ) {
207+
if (std::abs(collision.posZ()) > selectMaxVtxZ) {
206208
return;
207209
}
208210
if (fractionOfSampledEvents < 1.f && (static_cast<float>(rand()) / static_cast<float>(RAND_MAX)) > fractionOfSampledEvents) { // Skip events that are not sampled

DPG/Tasks/AOTTrack/qaSignChargeMC.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct QaSignChargeMC {
6060
o2::aod::McParticles const&)
6161
{
6262
for (auto const& track : tracks) {
63-
if (abs(track.eta()) > 0.8) {
63+
if (std::abs(track.eta()) > 0.8) {
6464
continue;
6565
}
6666
if (!track.hasITS()) {
@@ -73,7 +73,7 @@ struct QaSignChargeMC {
7373
continue;
7474
}
7575
if (absPDG) {
76-
if (abs(track.mcParticle().pdgCode()) != PDG) {
76+
if (std::abs(track.mcParticle().pdgCode()) != PDG) {
7777
continue;
7878
}
7979
} else {

DPG/Tasks/AOTTrack/qaTrackSelection.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct QaTrackCuts {
125125
customTrackCuts.SetRequireGoldenChi2(requireGoldenChi2.value);
126126
customTrackCuts.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value);
127127
customTrackCuts.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value);
128-
if (abs(maxDcaXYFactor.value - 1.f) > 1e-6) { // No DCAxy cut will be used, this is done via the member function of the task
128+
if (std::abs(maxDcaXYFactor.value - 1.f) > 1e-6) { // No DCAxy cut will be used, this is done via the member function of the task
129129
customTrackCuts.SetMaxDcaXYPtDep([](float /*pt*/) { return 10000.f; });
130130
}
131131
customTrackCuts.SetMaxDcaZ(maxDcaZ.value);

0 commit comments

Comments
 (0)