Skip to content

Commit a00d231

Browse files
author
Chiara De Martin
committed
fix abs value with std::abs
1 parent 65196c1 commit a00d231

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

PWGLF/TableProducer/Strangeness/cascadeflow.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ struct cascadeFlow {
262262
histos.fill(HIST("hNEvents"), 1.5);
263263

264264
// Z vertex selection
265-
if (TMath::Abs(collision.posZ()) > cutzvertex) {
265+
if (std::abs(collision.posZ()) > cutzvertex) {
266266
return false;
267267
}
268268
if (isFillHisto)
@@ -1064,14 +1064,14 @@ struct cascadeFlow {
10641064

10651065
// select only events used for the calibration of the event plane
10661066
if (isGoodEventEP) {
1067-
if (abs(coll.qvecFT0CRe()) > 990 || abs(coll.qvecFT0CIm()) > 990 || abs(coll.qvecBNegRe()) > 990 || abs(coll.qvecBNegIm()) > 990 || abs(coll.qvecBPosRe()) > 990 || abs(coll.qvecBPosIm()) > 990) {
1067+
if (std::abs(coll.qvecFT0CRe()) > 990 || std::abs(coll.qvecFT0CIm()) > 990 || std::abs(coll.qvecBNegRe()) > 990 || std::abs(coll.qvecBNegIm()) > 990 || std::abs(coll.qvecBPosRe()) > 990 || std::abs(coll.qvecBPosIm()) > 990) {
10681068
return;
10691069
}
10701070
}
10711071

10721072
// event has FT0C event plane
10731073
bool hasEventPlane = 0;
1074-
if (abs(coll.qvecFT0CRe()) < 990 && abs(coll.qvecFT0CIm()) < 990)
1074+
if (std::abs(coll.qvecFT0CRe()) < 990 && std::abs(coll.qvecFT0CIm()) < 990)
10751075
hasEventPlane = 1;
10761076

10771077
histos.fill(HIST("hNEvents"), 9.5);
@@ -1331,14 +1331,14 @@ struct cascadeFlow {
13311331

13321332
// select only events used for the calibration of the event plane
13331333
if (isGoodEventEP) {
1334-
if (abs(coll.qvecFT0CRe()) > 990 || abs(coll.qvecFT0CIm()) > 990 || abs(coll.qvecBNegRe()) > 990 || abs(coll.qvecBNegIm()) > 990 || abs(coll.qvecBPosRe()) > 990 || abs(coll.qvecBPosIm()) > 990) {
1334+
if (std::abs(coll.qvecFT0CRe()) > 990 || std::abs(coll.qvecFT0CIm()) > 990 || std::abs(coll.qvecBNegRe()) > 990 || std::abs(coll.qvecBNegIm()) > 990 || std::abs(coll.qvecBPosRe()) > 990 || std::abs(coll.qvecBPosIm()) > 990) {
13351335
return;
13361336
}
13371337
}
13381338

13391339
// event has FT0C event plane
13401340
bool hasEventPlane = 0;
1341-
if (abs(coll.qvecFT0CRe()) < 990 && abs(coll.qvecFT0CIm()) < 990)
1341+
if (std::abs(coll.qvecFT0CRe()) < 990 && std::abs(coll.qvecFT0CIm()) < 990)
13421342
hasEventPlane = 1;
13431343

13441344
// event has spectator plane
@@ -1609,7 +1609,7 @@ struct cascadeFlow {
16091609
histosMCGen.fill(HIST("hZvertexGen"), mcCollision.posZ());
16101610
histosMCGen.fill(HIST("hNEventsMC"), 0.5);
16111611
// Generated with accepted z vertex
1612-
if (TMath::Abs(mcCollision.posZ()) > cutzvertex) {
1612+
if (std::abs(mcCollision.posZ()) > cutzvertex) {
16131613
return;
16141614
}
16151615
histosMCGen.fill(HIST("hNEventsMC"), 1.5);
@@ -1642,21 +1642,21 @@ struct cascadeFlow {
16421642
histosMCGen.fill(HIST("hNEventsMC"), 5.5);
16431643

16441644
for (auto const& cascmc : cascMC) {
1645-
if (TMath::Abs(cascmc.pdgCode()) == 3312)
1645+
if (std::abs(cascmc.pdgCode()) == 3312)
16461646
histosMCGen.fill(HIST("hNCascGen"), 0.5);
1647-
else if (TMath::Abs(cascmc.pdgCode()) == 3334)
1647+
else if (std::abs(cascmc.pdgCode()) == 3334)
16481648
histosMCGen.fill(HIST("hNCascGen"), 1.5);
16491649
if (!cascmc.has_straMCCollision())
16501650
continue;
1651-
if (TMath::Abs(cascmc.pdgCode()) == 3312)
1651+
if (std::abs(cascmc.pdgCode()) == 3312)
16521652
histosMCGen.fill(HIST("hNCascGen"), 2.5);
1653-
else if (TMath::Abs(cascmc.pdgCode()) == 3334)
1653+
else if (std::abs(cascmc.pdgCode()) == 3334)
16541654
histosMCGen.fill(HIST("hNCascGen"), 3.5);
16551655
if (!cascmc.isPhysicalPrimary())
16561656
continue;
1657-
if (TMath::Abs(cascmc.pdgCode()) == 3312)
1657+
if (std::abs(cascmc.pdgCode()) == 3312)
16581658
histosMCGen.fill(HIST("hNCascGen"), 4.5);
1659-
else if (TMath::Abs(cascmc.pdgCode()) == 3334)
1659+
else if (std::abs(cascmc.pdgCode()) == 3334)
16601660
histosMCGen.fill(HIST("hNCascGen"), 5.5);
16611661

16621662
float ptmc = RecoDecay::sqrtSumOfSquares(cascmc.pxMC(), cascmc.pyMC());
@@ -1675,22 +1675,22 @@ struct cascadeFlow {
16751675
float cascMCeta = -log(std::tan(theta1 / 2));
16761676
float cascMCy = 0;
16771677

1678-
if (TMath::Abs(cascmc.pdgCode()) == 3312) {
1678+
if (std::abs(cascmc.pdgCode()) == 3312) {
16791679
cascMCy = RecoDecay::y(std::array{cascmc.pxMC(), cascmc.pyMC(), cascmc.pzMC()}, constants::physics::MassXiMinus);
1680-
if (TMath::Abs(cascMCeta) < etaCascMCGen) {
1680+
if (std::abs(cascMCeta) < etaCascMCGen) {
16811681
histosMCGen.fill(HIST("h2DGenXiEta08"), centrality, ptmc);
16821682
histosMCGen.fill(HIST("hNCascGen"), 6.5);
16831683
}
1684-
if (TMath::Abs(cascMCy) < yCascMCGen)
1684+
if (std::abs(cascMCy) < yCascMCGen)
16851685
histosMCGen.fill(HIST("h2DGenXiY05"), centrality, ptmc);
16861686
histosMCGen.fill(HIST("hGenXiY"), cascMCy);
1687-
} else if (TMath::Abs(cascmc.pdgCode() == 3334)) {
1687+
} else if (std::abs(cascmc.pdgCode() == 3334)) {
16881688
cascMCy = RecoDecay::y(std::array{cascmc.pxMC(), cascmc.pyMC(), cascmc.pzMC()}, constants::physics::MassOmegaMinus);
1689-
if (TMath::Abs(cascMCeta) < etaCascMCGen) {
1689+
if (std::abs(cascMCeta) < etaCascMCGen) {
16901690
histosMCGen.fill(HIST("h2DGenOmegaEta08"), centrality, ptmc);
16911691
histosMCGen.fill(HIST("hNCascGen"), 7.5);
16921692
}
1693-
if (TMath::Abs(cascMCy) < yCascMCGen)
1693+
if (std::abs(cascMCy) < yCascMCGen)
16941694
histosMCGen.fill(HIST("h2DGenOmegaY05"), centrality, ptmc);
16951695
histosMCGen.fill(HIST("hGenOmegaY"), cascMCy);
16961696
}

0 commit comments

Comments
 (0)