Skip to content

Commit f7de218

Browse files
author
nkaratze
committed
Changed TMath::Abs to std::abs
1 parent 659bc98 commit f7de218

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

PWGLF/Tasks/Strangeness/v0topologicalcuts.cxx

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ struct v0topologicalcuts {
284284
const auto& mLambdaPDG = 1.115683;
285285
const auto& mK0shPDG = 0.497611;
286286
for (const auto& v0 : V0s) {
287-
if (TMath::Abs(v0.posTrack_as<DaughterTracks>().eta()) < etadau && TMath::Abs(v0.negTrack_as<DaughterTracks>().eta()) < etadau) { // daughters pseudorapidity cut
287+
if (std::abs(v0.posTrack_as<DaughterTracks>().eta()) < etadau && std::abs(v0.negTrack_as<DaughterTracks>().eta()) < etadau) { // daughters pseudorapidity cut
288288
// filling histograms with V0 values
289289
rV0Parameters_MC_V0match.fill(HIST("hDCAV0Daughters_V0_Match"), v0.dcaV0daughters());
290290
rV0Parameters_MC_V0match.fill(HIST("hV0CosPA_V0_Match"), v0.v0cosPA());
@@ -297,13 +297,13 @@ struct v0topologicalcuts {
297297
// Checking that the V0 is a true K0s/Lambdas/Antilambdas and then filling the parameter histograms and the invariant mass plots for different cuts (which are taken from namespace)
298298
if (v0.has_mcParticle()) {
299299
auto v0mcParticle = v0.mcParticle();
300-
if (v0mcParticle.pdgCode() == 310) { // kzero matched
301-
if (TMath::Abs(v0.mLambda() - mLambdaPDG) > compv0masscut && TMath::Abs(v0.mAntiLambda() - mLambdaPDG) > compv0masscut) { // Kzero competitive v0 mass cut (cut out Lambdas and Anti-Lambdas)
300+
if (v0mcParticle.pdgCode() == 310) { // kzero matched
301+
if (std::abs(v0.mLambda() - mLambdaPDG) > compv0masscut && std::abs(v0.mAntiLambda() - mLambdaPDG) > compv0masscut) { // Kzero competitive v0 mass cut (cut out Lambdas and Anti-Lambdas)
302302
rV0Parameters_MC_K0Smatch.fill(HIST("hDCAV0Daughters_KzeroMC_Match"), v0.dcaV0daughters());
303303
rV0Parameters_MC_K0Smatch.fill(HIST("hV0CosPA_KzeroMC_Match"), v0.v0cosPA());
304304
rV0Parameters_MC_K0Smatch.fill(HIST("hV0Radius_KzeroMC_Match"), v0.v0radius());
305-
rV0Parameters_MC_K0Smatch.fill(HIST("hDCAPostoPV_KzeroMC_Match"), TMath::Abs(v0.dcapostopv()));
306-
rV0Parameters_MC_K0Smatch.fill(HIST("hDCANegtoPV_KzeroMC_Match"), TMath::Abs(v0.dcanegtopv()));
305+
rV0Parameters_MC_K0Smatch.fill(HIST("hDCAPostoPV_KzeroMC_Match"), std::abs(v0.dcapostopv()));
306+
rV0Parameters_MC_K0Smatch.fill(HIST("hDCANegtoPV_KzeroMC_Match"), std::abs(v0.dcanegtopv()));
307307

308308
for (uint32_t j = 0; j < cuthistoskzerosh::cospacuts.size(); j++) {
309309
std::string cospacut = cuthistoskzerosh::cospacuts[j]; // Get the current cut value from the namespace
@@ -337,7 +337,7 @@ struct v0topologicalcuts {
337337
size_t pos = dcapostopcut.find("_");
338338
dcapostopcut[pos] = '.';
339339
const float dcapostopcutvalue = std::stod(dcapostopcut);
340-
if (TMath::Abs(v0.dcapostopv()) > dcapostopcutvalue) {
340+
if (std::abs(v0.dcapostopv()) > dcapostopcutvalue) {
341341
cuthistoskzerosh::dcapostopCut[j]->Fill(v0.mK0Short());
342342
}
343343
}
@@ -346,19 +346,19 @@ struct v0topologicalcuts {
346346
size_t pos = dcanegtopcut.find("_");
347347
dcanegtopcut[pos] = '.';
348348
const float dcanegtopcutvalue = std::stod(dcanegtopcut);
349-
if (TMath::Abs(v0.dcanegtopv()) > dcanegtopcutvalue) {
349+
if (std::abs(v0.dcanegtopv()) > dcanegtopcutvalue) {
350350
cuthistoskzerosh::dcanegtopCut[j]->Fill(v0.mK0Short());
351351
}
352352
}
353353
}
354354
}
355-
if (v0mcParticle.pdgCode() == 3122) { // lambda matched
356-
if (TMath::Abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons)
355+
if (v0mcParticle.pdgCode() == 3122) { // lambda matched
356+
if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons)
357357
rV0Parameters_MC_Lambdamatch.fill(HIST("hDCAV0Daughters_LambdaMC_Match"), v0.dcaV0daughters());
358358
rV0Parameters_MC_Lambdamatch.fill(HIST("hV0CosPA_LambdaMC_Match"), v0.v0cosPA());
359359
rV0Parameters_MC_Lambdamatch.fill(HIST("hV0Radius_LambdaMC_Match"), v0.v0radius());
360-
rV0Parameters_MC_Lambdamatch.fill(HIST("hDCAPostoPV_LambdaMC_Match"), TMath::Abs(v0.dcapostopv()));
361-
rV0Parameters_MC_Lambdamatch.fill(HIST("hDCANegtoPV_LambdaMC_Match"), TMath::Abs(v0.dcanegtopv()));
360+
rV0Parameters_MC_Lambdamatch.fill(HIST("hDCAPostoPV_LambdaMC_Match"), std::abs(v0.dcapostopv()));
361+
rV0Parameters_MC_Lambdamatch.fill(HIST("hDCANegtoPV_LambdaMC_Match"), std::abs(v0.dcanegtopv()));
362362

363363
// for explanation look at the first Kzero plot above
364364
for (uint32_t j = 0; j < cuthistoslambda::cospacuts.size(); j++) {
@@ -393,7 +393,7 @@ struct v0topologicalcuts {
393393
size_t pos = dcapostopcutlambda.find("_");
394394
dcapostopcutlambda[pos] = '.';
395395
const float dcapostopcutlambdavalue = std::stod(dcapostopcutlambda);
396-
if (TMath::Abs(v0.dcapostopv()) > dcapostopcutlambdavalue) {
396+
if (std::abs(v0.dcapostopv()) > dcapostopcutlambdavalue) {
397397
cuthistoslambda::dcapostopCut[j]->Fill(v0.mLambda());
398398
}
399399
}
@@ -402,19 +402,19 @@ struct v0topologicalcuts {
402402
size_t pos = dcanegtopcutlambda.find("_");
403403
dcanegtopcutlambda[pos] = '.';
404404
const float dcanegtopcutlambdavalue = std::stod(dcanegtopcutlambda);
405-
if (TMath::Abs(v0.dcanegtopv()) > dcanegtopcutlambdavalue) {
405+
if (std::abs(v0.dcanegtopv()) > dcanegtopcutlambdavalue) {
406406
cuthistoslambda::dcanegtopCut[j]->Fill(v0.mLambda());
407407
}
408408
}
409409
}
410410
}
411-
if (v0mcParticle.pdgCode() == -3122) { // antilambda matched
412-
if (TMath::Abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons)
411+
if (v0mcParticle.pdgCode() == -3122) { // antilambda matched
412+
if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons)
413413
rV0Parameters_MC_AntiLambdamatch.fill(HIST("hDCAV0Daughters_AntiLambdaMC_Match"), v0.dcaV0daughters());
414414
rV0Parameters_MC_AntiLambdamatch.fill(HIST("hV0CosPA_AntiLambdaMC_Match"), v0.v0cosPA());
415415
rV0Parameters_MC_AntiLambdamatch.fill(HIST("hV0Radius_AntiLambdaMC_Match"), v0.v0radius());
416-
rV0Parameters_MC_AntiLambdamatch.fill(HIST("hDCAPostoPV_AntiLambdaMC_Match"), TMath::Abs(v0.dcapostopv()));
417-
rV0Parameters_MC_AntiLambdamatch.fill(HIST("hDCANegtoPV_AntiLambdaMC_Match"), TMath::Abs(v0.dcanegtopv()));
416+
rV0Parameters_MC_AntiLambdamatch.fill(HIST("hDCAPostoPV_AntiLambdaMC_Match"), std::abs(v0.dcapostopv()));
417+
rV0Parameters_MC_AntiLambdamatch.fill(HIST("hDCANegtoPV_AntiLambdaMC_Match"), std::abs(v0.dcanegtopv()));
418418
// for explanation look at the first Kzero plot above
419419
for (uint32_t j = 0; j < cuthistosantilambda::cospacuts.size(); j++) {
420420
std::string cospacutantilambda = cuthistosantilambda::cospacuts[j];
@@ -448,7 +448,7 @@ struct v0topologicalcuts {
448448
size_t pos = dcapostopantilambda.find("_");
449449
dcapostopantilambda[pos] = '.';
450450
const float dcapostopcutantilambdavalue = std::stod(dcapostopantilambda);
451-
if (TMath::Abs(v0.dcapostopv()) > dcapostopcutantilambdavalue) {
451+
if (std::abs(v0.dcapostopv()) > dcapostopcutantilambdavalue) {
452452
cuthistosantilambda::dcapostopCut[j]->Fill(v0.mAntiLambda());
453453
}
454454
}
@@ -457,7 +457,7 @@ struct v0topologicalcuts {
457457
size_t pos = dcanegtopantilambda.find("_");
458458
dcanegtopantilambda[pos] = '.';
459459
const float dcanegtopcutantilambdavalue = std::stod(dcanegtopantilambda);
460-
if (TMath::Abs(v0.dcanegtopv()) > dcanegtopcutantilambdavalue) {
460+
if (std::abs(v0.dcanegtopv()) > dcanegtopcutantilambdavalue) {
461461
cuthistosantilambda::dcanegtopCut[j]->Fill(v0.mAntiLambda());
462462
}
463463
}
@@ -485,14 +485,14 @@ struct v0topologicalcuts {
485485
rV0Parameters_Data.fill(HIST("hV0CosPA_V0_Data"), v0.v0cosPA());
486486
rV0Parameters_Data.fill(HIST("hV0Radius_V0_Data"), v0.v0radius());
487487
rV0Parameters_Data.fill(HIST("hV0Radius_Full_V0_Data"), v0.v0radius());
488-
rV0Parameters_Data.fill(HIST("hDCAPostoPV_V0_Data"), TMath::Abs(v0.dcapostopv()));
489-
rV0Parameters_Data.fill(HIST("hDCANegtoPV_V0_Data"), TMath::Abs(v0.dcanegtopv()));
488+
rV0Parameters_Data.fill(HIST("hDCAPostoPV_V0_Data"), std::abs(v0.dcapostopv()));
489+
rV0Parameters_Data.fill(HIST("hDCANegtoPV_V0_Data"), std::abs(v0.dcanegtopv()));
490490
rV0Parameters_Data.fill(HIST("hVertexZRec"), collision.posZ());
491491

492-
if (TMath::Abs(v0.posTrack_as<DaughterTracks>().eta()) < etadau && TMath::Abs(v0.negTrack_as<DaughterTracks>().eta()) < etadau) { // daughters pseudorapidity cut
493-
if (TMath::Abs(posDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion && TMath::Abs(negDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion) { // TPC PID on daughter pions
492+
if (std::abs(v0.posTrack_as<DaughterTracks>().eta()) < etadau && std::abs(v0.negTrack_as<DaughterTracks>().eta()) < etadau) { // daughters pseudorapidity cut
493+
if (std::abs(posDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion && std::abs(negDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion) { // TPC PID on daughter pions
494494
rV0Parameters_Data.fill(HIST("hMassK0ShortAllAfterCutsandTPCPID"), v0.mK0Short());
495-
if (TMath::Abs(v0.mLambda() - mLambdaPDG) > compv0masscut && TMath::Abs(v0.mAntiLambda() - mLambdaPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Lambdas and Anti-Lambdas)
495+
if (std::abs(v0.mLambda() - mLambdaPDG) > compv0masscut && std::abs(v0.mAntiLambda() - mLambdaPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Lambdas and Anti-Lambdas)
496496
rV0Parameters_Data.fill(HIST("hMassK0ShortAllAfterCutTPCPIDCompV0MassCut"), v0.mK0Short());
497497
// Filling the five Kzero invariant mass plots for different cuts (which are taken from namespace), for full explanation see the first kzero cut filling in the MC process
498498
for (uint32_t j = 0; j < cuthistoskzerosh::cospacuts.size(); j++) {
@@ -527,7 +527,7 @@ struct v0topologicalcuts {
527527
size_t pos = dcapostopcut.find("_");
528528
dcapostopcut[pos] = '.';
529529
const float dcapostopcutvalue = std::stod(dcapostopcut);
530-
if (TMath::Abs(v0.dcapostopv()) > dcapostopcutvalue) {
530+
if (std::abs(v0.dcapostopv()) > dcapostopcutvalue) {
531531
cuthistoskzerosh::dcapostopCut[j]->Fill(v0.mK0Short());
532532
}
533533
}
@@ -536,15 +536,15 @@ struct v0topologicalcuts {
536536
size_t pos = dcanegtopcut.find("_");
537537
dcanegtopcut[pos] = '.';
538538
const float dcanegtopcutvalue = std::stod(dcanegtopcut);
539-
if (TMath::Abs(v0.dcanegtopv()) > dcanegtopcutvalue) {
539+
if (std::abs(v0.dcanegtopv()) > dcanegtopcutvalue) {
540540
cuthistoskzerosh::dcanegtopCut[j]->Fill(v0.mK0Short());
541541
}
542542
}
543543
}
544544
}
545-
if (TMath::Abs(posDaughterTrack.tpcNSigmaPr()) < NSigmaTPCProton && TMath::Abs(negDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion) { // TPC PID on daughter pion and proton
545+
if (std::abs(posDaughterTrack.tpcNSigmaPr()) < NSigmaTPCProton && std::abs(negDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion) { // TPC PID on daughter pion and proton
546546
rV0Parameters_Data.fill(HIST("hMassLambdaAllAfterCutsandTPCPID"), v0.mLambda());
547-
if (TMath::Abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // lambda competitive v0 mass cut (cut out Kaons)
547+
if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // lambda competitive v0 mass cut (cut out Kaons)
548548
// Filling the five Lambda invariant mass plots for different cuts (which are taken from namespace), same as with Kzeros above,for full explanation see the first kzero cut filling in the MC process
549549
for (uint32_t j = 0; j < cuthistoslambda::cospacuts.size(); j++) {
550550
std::string cospacutlambda = cuthistoslambda::cospacuts[j];
@@ -578,7 +578,7 @@ struct v0topologicalcuts {
578578
size_t pos = dcapostopcutlambda.find("_");
579579
dcapostopcutlambda[pos] = '.';
580580
const float dcapostopcutlambdavalue = std::stod(dcapostopcutlambda);
581-
if (TMath::Abs(v0.dcapostopv()) > dcapostopcutlambdavalue) {
581+
if (std::abs(v0.dcapostopv()) > dcapostopcutlambdavalue) {
582582
cuthistoslambda::dcapostopCut[j]->Fill(v0.mLambda());
583583
}
584584
}
@@ -587,15 +587,15 @@ struct v0topologicalcuts {
587587
size_t pos = dcanegtopcutlambda.find("_");
588588
dcanegtopcutlambda[pos] = '.';
589589
const float dcanegtopcutlambdavalue = std::stod(dcanegtopcutlambda);
590-
if (TMath::Abs(v0.dcanegtopv()) > dcanegtopcutlambdavalue) {
590+
if (std::abs(v0.dcanegtopv()) > dcanegtopcutlambdavalue) {
591591
cuthistoslambda::dcanegtopCut[j]->Fill(v0.mLambda());
592592
}
593593
}
594594
}
595595
}
596-
if (TMath::Abs(posDaughterTrack.tpcNSigmaPr()) < NSigmaTPCProton && TMath::Abs(negDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion) { // TPC PID on daughter pion abd proton
596+
if (std::abs(posDaughterTrack.tpcNSigmaPr()) < NSigmaTPCProton && std::abs(negDaughterTrack.tpcNSigmaPi()) < NSigmaTPCPion) { // TPC PID on daughter pion abd proton
597597
rV0Parameters_Data.fill(HIST("hMassAntilambdaAllAfterCutsandTPCPID"), v0.mAntiLambda());
598-
if (TMath::Abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons)
598+
if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons)
599599
// Filling the five Anti-Lambda invariant mass plots for different cuts (which are taken from namespace), same as with Kzeros and Lambdas above,for full explanation see the first kzero cut filling in the MC process
600600
for (uint32_t j = 0; j < cuthistosantilambda::cospacuts.size(); j++) {
601601
std::string cospacutantilambda = cuthistosantilambda::cospacuts[j];
@@ -629,7 +629,7 @@ struct v0topologicalcuts {
629629
size_t pos = dcapostopantilambda.find("_");
630630
dcapostopantilambda[pos] = '.';
631631
const float dcapostopcutantilambdavalue = std::stod(dcapostopantilambda);
632-
if (TMath::Abs(v0.dcapostopv()) > dcapostopcutantilambdavalue) {
632+
if (std::abs(v0.dcapostopv()) > dcapostopcutantilambdavalue) {
633633
cuthistosantilambda::dcapostopCut[j]->Fill(v0.mAntiLambda());
634634
}
635635
}
@@ -638,7 +638,7 @@ struct v0topologicalcuts {
638638
size_t pos = dcanegtopantilambda.find("_");
639639
dcanegtopantilambda[pos] = '.';
640640
const float dcanegtopcutantilambdavalue = std::stod(dcanegtopantilambda);
641-
if (TMath::Abs(v0.dcanegtopv()) > dcanegtopcutantilambdavalue) {
641+
if (std::abs(v0.dcanegtopv()) > dcanegtopcutantilambdavalue) {
642642
cuthistosantilambda::dcanegtopCut[j]->Fill(v0.mAntiLambda());
643643
}
644644
}

0 commit comments

Comments
 (0)