Skip to content

Commit 98c8537

Browse files
committed
fixed build issues and o2linter
1 parent 1958772 commit 98c8537

2 files changed

Lines changed: 37 additions & 43 deletions

File tree

PWGLF/Tasks/Resonances/k892hadronphoton.cxx

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12-
// This is a task that reads kstar tables (from sigma0builder) to perform analysis.
13-
// *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
14-
// k892hadronphoton analysis task
15-
// *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
16-
//
17-
// Comments, questions, complaints, suggestions?
18-
// Please write to:
19-
// oussama.benchikhi@cern.ch
20-
// gianni.shigeru.setoue.liveraro@cern.ch
21-
//
12+
13+
/// \file k892hadronphoton.cxx
14+
/// \brief This is a task that reads kstar tables (from sigma0builder) to perform analysis.
15+
/// \author Gianni Shigeru Setoue Liveraro
16+
/// \author Oussama Benchikhi
2217

2318
#include "PWGLF/DataModel/LFSigmaTables.h"
2419
#include "PWGLF/DataModel/LFStrangenessTables.h"
@@ -42,7 +37,6 @@
4237

4338
#include <TH1.h>
4439
#include <TH2.h>
45-
#include <TMath.h>
4640
#include <TPDGCode.h>
4741
#include <TString.h>
4842

@@ -897,7 +891,7 @@ struct k892hadronphoton {
897891
if (std::abs(kshortPDGCodeGrandMother) == o2::constants::physics::Pdg::kK0Star892 && std::abs(photonPDGCodeGrandMother) == o2::constants::physics::Pdg::kK0Star892 && (photonGlobalIndexGrandMother == kshortGlobalIndexGrandMother)) // K*(892)0
898892
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_KStarPionKaon"), kstarpT, kstarMass);
899893

900-
if ((photonGlobalIndexGrandMother == kshortGlobalIndexGrandMother)) {
894+
if (photonGlobalIndexGrandMother == kshortGlobalIndexGrandMother) {
901895
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassKStar_PionKaon"), kstarpT, kstarMass);
902896
histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPionKaonMother"), kshortPDGCodeGrandMother, photonPDGCodeGrandMother);
903897
}
@@ -943,7 +937,7 @@ struct k892hadronphoton {
943937
int gammaTrkCode = retrieveV0TrackCode<true>(kstar);
944938
int kshortTrkCode = retrieveV0TrackCode<false>(kstar);
945939

946-
float photonRZLineCut = TMath::Abs(kstar.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.photonMaxDauEta))) - photonSelections.photonLineCutZ0;
940+
float photonRZLineCut = std::abs(kstar.photonZconv()) * std::tan(2 * std::atan(std::exp(-photonSelections.photonMaxDauEta))) - photonSelections.photonLineCutZ0;
947941
float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();
948942
//_______________________________________
949943
// Photon
@@ -1028,11 +1022,11 @@ struct k892hadronphoton {
10281022
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPosTPCNSigmaEl"), kstar.photonPosTPCNSigmaEl());
10291023
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hNegTPCNSigmaEl"), kstar.photonNegTPCNSigmaEl());
10301024

1031-
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(kstar.photonCosPA()), kstar.photonmcpt());
1025+
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), std::acos(kstar.photonCosPA()), kstar.photonmcpt());
10321026

10331027
if (!kstar.photonIsCorrectlyAssoc()) {
10341028
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), kstar.photonmcpt());
1035-
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(kstar.photonCosPA()), kstar.photonmcpt());
1029+
histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), std::acos(kstar.photonCosPA()), kstar.photonmcpt());
10361030
}
10371031
}
10381032

@@ -1191,11 +1185,11 @@ struct k892hadronphoton {
11911185
return false;
11921186

11931187
fillSelHistos<1>(cand, PDG_t::kGamma);
1194-
if ((TMath::Abs(cand.photonDCAPosPV()) < photonSelections.photonMinDCADauToPv) || (TMath::Abs(cand.photonDCANegPV()) < photonSelections.photonMinDCADauToPv))
1188+
if ((std::abs(cand.photonDCAPosPV()) < photonSelections.photonMinDCADauToPv) || (std::abs(cand.photonDCANegPV()) < photonSelections.photonMinDCADauToPv))
11951189
return false;
11961190

11971191
fillSelHistos<2>(cand, PDG_t::kGamma);
1198-
if (TMath::Abs(cand.photonDCADau()) > photonSelections.photonMaxDCAV0Dau)
1192+
if (std::abs(cand.photonDCADau()) > photonSelections.photonMaxDCAV0Dau)
11991193
return false;
12001194

12011195
fillSelHistos<3>(cand, PDG_t::kGamma);
@@ -1214,39 +1208,39 @@ struct k892hadronphoton {
12141208
return false;
12151209

12161210
fillSelHistos<6>(cand, PDG_t::kGamma);
1217-
if ((TMath::Abs(cand.photonY()) > photonSelections.photonMaxRap) || (TMath::Abs(cand.photonPosEta()) > photonSelections.photonMaxDauEta) || (TMath::Abs(cand.photonNegEta()) > photonSelections.photonMaxDauEta))
1211+
if ((std::abs(cand.photonY()) > photonSelections.photonMaxRap) || (std::abs(cand.photonPosEta()) > photonSelections.photonMaxDauEta) || (std::abs(cand.photonNegEta()) > photonSelections.photonMaxDauEta))
12181212
return false;
12191213

12201214
fillSelHistos<7>(cand, PDG_t::kGamma);
12211215
if ((cand.photonRadius() < photonSelections.photonMinRadius) || (cand.photonRadius() > photonSelections.photonMaxRadius))
12221216
return false;
12231217

12241218
fillSelHistos<8>(cand, PDG_t::kGamma);
1225-
float photonRZLineCut = TMath::Abs(cand.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.photonMaxDauEta))) - photonSelections.photonLineCutZ0;
1226-
if ((TMath::Abs(cand.photonRadius()) < photonRZLineCut) || (TMath::Abs(cand.photonZconv()) > photonSelections.photonMaxZ))
1219+
float photonRZLineCut = std::abs(cand.photonZconv()) * std::tan(2 * std::atan(std::exp(-photonSelections.photonMaxDauEta))) - photonSelections.photonLineCutZ0;
1220+
if ((std::abs(cand.photonRadius()) < photonRZLineCut) || (std::abs(cand.photonZconv()) > photonSelections.photonMaxZ))
12271221
return false;
12281222

12291223
fillSelHistos<9>(cand, PDG_t::kGamma);
12301224
if (cand.photonQt() > photonSelections.photonMaxQt)
12311225
return false;
12321226

1233-
if (TMath::Abs(cand.photonAlpha()) > photonSelections.photonMaxAlpha)
1227+
if (std::abs(cand.photonAlpha()) > photonSelections.photonMaxAlpha)
12341228
return false;
12351229

12361230
fillSelHistos<10>(cand, PDG_t::kGamma);
12371231
if (cand.photonCosPA() < photonSelections.photonMinV0cospa)
12381232
return false;
12391233

12401234
fillSelHistos<11>(cand, PDG_t::kGamma);
1241-
if (TMath::Abs(cand.photonPsiPair()) > photonSelections.photonPsiPairMax)
1235+
if (std::abs(cand.photonPsiPair()) > photonSelections.photonPsiPairMax)
12421236
return false;
12431237

12441238
fillSelHistos<12>(cand, PDG_t::kGamma);
12451239
if ((((cand.photonPhi() > photonSelections.photonPhiMin1) && (cand.photonPhi() < photonSelections.photonPhiMax1)) || ((cand.photonPhi() > photonSelections.photonPhiMin2) && (cand.photonPhi() < photonSelections.photonPhiMax2))) && ((photonSelections.photonPhiMin1 != -1) && (photonSelections.photonPhiMax1 != -1) && (photonSelections.photonPhiMin2 != -1) && (photonSelections.photonPhiMax2 != -1)))
12461240
return false;
12471241

12481242
fillSelHistos<13>(cand, PDG_t::kGamma);
1249-
if (TMath::Abs(cand.photonMass()) > photonSelections.photonMaxMass)
1243+
if (std::abs(cand.photonMass()) > photonSelections.photonMaxMass)
12501244
return false;
12511245

12521246
fillSelHistos<14>(cand, PDG_t::kGamma);
@@ -1262,22 +1256,22 @@ struct k892hadronphoton {
12621256
return false;
12631257

12641258
fillSelHistos<1>(cand, PDG_t::kK0Short);
1265-
if (TMath::Abs(cand.kshortDCADau()) > kshortSelections.kshortMaxDCAV0Dau)
1259+
if (std::abs(cand.kshortDCADau()) > kshortSelections.kshortMaxDCAV0Dau)
12661260
return false;
12671261

12681262
fillSelHistos<2>(cand, PDG_t::kK0Short);
12691263
if ((cand.kshortQt() < kshortSelections.kshortMinQt) || (cand.kshortQt() > kshortSelections.kshortMaxQt))
12701264
return false;
12711265

1272-
if ((TMath::Abs(cand.kshortAlpha()) < kshortSelections.kshortMinAlpha) || (TMath::Abs(cand.kshortAlpha()) > kshortSelections.kshortMaxAlpha))
1266+
if ((std::abs(cand.kshortAlpha()) < kshortSelections.kshortMinAlpha) || (std::abs(cand.kshortAlpha()) > kshortSelections.kshortMaxAlpha))
12731267
return false;
12741268

12751269
fillSelHistos<3>(cand, PDG_t::kK0Short);
12761270
if (cand.kshortCosPA() < kshortSelections.kshortMinv0cospa)
12771271
return false;
12781272

12791273
fillSelHistos<4>(cand, PDG_t::kK0Short);
1280-
if ((TMath::Abs(cand.kshortY()) > kshortSelections.kshortMaxRap) || (TMath::Abs(cand.kshortPosEta()) > kshortSelections.kshortMaxDauEta) || (TMath::Abs(cand.kshortNegEta()) > kshortSelections.kshortMaxDauEta))
1274+
if ((std::abs(cand.kshortY()) > kshortSelections.kshortMaxRap) || (std::abs(cand.kshortPosEta()) > kshortSelections.kshortMaxDauEta) || (std::abs(cand.kshortNegEta()) > kshortSelections.kshortMaxDauEta))
12811275
return false;
12821276

12831277
fillSelHistos<5>(cand, PDG_t::kK0Short);
@@ -1302,24 +1296,24 @@ struct k892hadronphoton {
13021296
fillSelHistos<8>(cand, PDG_t::kK0Short);
13031297

13041298
// TPC Selection
1305-
if (kshortSelections.fselKShortTPCPID && (TMath::Abs(cand.kshortPosPiTPCNSigma()) > kshortSelections.kshortMaxTPCNSigmas))
1299+
if (kshortSelections.fselKShortTPCPID && (std::abs(cand.kshortPosPiTPCNSigma()) > kshortSelections.kshortMaxTPCNSigmas))
13061300
return false;
1307-
if (kshortSelections.fselKShortTPCPID && (TMath::Abs(cand.kshortNegPiTPCNSigma()) > kshortSelections.kshortMaxTPCNSigmas))
1301+
if (kshortSelections.fselKShortTPCPID && (std::abs(cand.kshortNegPiTPCNSigma()) > kshortSelections.kshortMaxTPCNSigmas))
13081302
return false;
13091303

13101304
// // TOF Selection
1311-
// if (kshortSelections.fselKShortTOFPID && (TMath::Abs(cand.kshortPiTOFNSigma()) > kshortSelections.kshortPiMaxTOFNSigmas))
1305+
// if (kshortSelections.fselKShortTOFPID && (std::abs(cand.kshortPiTOFNSigma()) > kshortSelections.kshortPiMaxTOFNSigmas))
13121306
// return false;
1313-
// if (kshortSelections.fselKShortTOFPID && (TMath::Abs(cand.lambdaPiTOFNSigma()) > kshortSelections.kshortPiMaxTOFNSigmas))
1307+
// if (kshortSelections.fselKShortTOFPID && (std::abs(cand.lambdaPiTOFNSigma()) > kshortSelections.kshortPiMaxTOFNSigmas))
13141308
// return false;
13151309
// DCA Selection
13161310
fillSelHistos<9>(cand, PDG_t::kK0Short);
1317-
if ((TMath::Abs(cand.kshortDCAPosPV()) < kshortSelections.kshortMinDCAPosToPv) || (TMath::Abs(cand.kshortDCANegPV()) < kshortSelections.kshortMinDCANegToPv))
1311+
if ((std::abs(cand.kshortDCAPosPV()) < kshortSelections.kshortMinDCAPosToPv) || (std::abs(cand.kshortDCANegPV()) < kshortSelections.kshortMinDCANegToPv))
13181312
return false;
13191313

13201314
// Mass Selection
13211315
fillSelHistos<10>(cand, PDG_t::kK0Short);
1322-
if (TMath::Abs(cand.kshortMass() - o2::constants::physics::MassK0Short) > kshortSelections.kshortWindow)
1316+
if (std::abs(cand.kshortMass() - o2::constants::physics::MassK0Short) > kshortSelections.kshortWindow)
13231317
return false;
13241318

13251319
fillSelHistos<11>(cand, PDG_t::kK0Short);
@@ -1342,10 +1336,10 @@ struct k892hadronphoton {
13421336
// KStar specific selections
13431337
// Rapidity
13441338
if constexpr (requires { cand.kstarMCY(); }) { // MC
1345-
if (TMath::Abs(cand.kstarMCY()) > kstarSelections.kstarMaxRap)
1339+
if (std::abs(cand.kstarMCY()) > kstarSelections.kstarMaxRap)
13461340
return false;
13471341
} else { // Real data
1348-
if (TMath::Abs(cand.kstarY()) > kstarSelections.kstarMaxRap)
1342+
if (std::abs(cand.kstarY()) > kstarSelections.kstarMaxRap)
13491343
return false;
13501344
}
13511345

PWGLF/Tasks/Resonances/k892hadronphotonBkg.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,11 @@ struct k892hadronphotonBkg {
430430
return false;
431431

432432
histos.fill(HIST("PhotonSel/hSelectionStatistics"), 5.);
433-
if ((TMath::Abs(gamma.dcapostopv()) < photonSelections.photonMinDCADauToPv) || (TMath::Abs(gamma.dcanegtopv()) < photonSelections.photonMinDCADauToPv))
433+
if ((std::abs(gamma.dcapostopv()) < photonSelections.photonMinDCADauToPv) || (std::abs(gamma.dcanegtopv()) < photonSelections.photonMinDCADauToPv))
434434
return false;
435435

436436
histos.fill(HIST("PhotonSel/hSelectionStatistics"), 6.);
437-
if (TMath::Abs(gamma.dcaV0daughters()) > photonSelections.photonMaxDCAV0Dau)
437+
if (std::abs(gamma.dcaV0daughters()) > photonSelections.photonMaxDCAV0Dau)
438438
return false;
439439

440440
histos.fill(HIST("PhotonSel/hSelectionStatistics"), 7.);
@@ -459,7 +459,7 @@ struct k892hadronphotonBkg {
459459
return false;
460460

461461
histos.fill(HIST("PhotonSel/hSelectionStatistics"), 12.);
462-
if (TMath::Abs(gamma.alpha()) > photonSelections.photonMaxAlpha)
462+
if (std::abs(gamma.alpha()) > photonSelections.photonMaxAlpha)
463463
return false;
464464

465465
auto posTrackGamma = gamma.template posTrackExtra_as<dauTracks>();
@@ -498,7 +498,7 @@ struct k892hadronphotonBkg {
498498
} else {
499499
// KShort basic selection criteria:
500500
histos.fill(HIST("KShortSel/hSelectionStatistics"), 1.);
501-
if ((TMath::Abs(kshort.mK0Short() - o2::constants::physics::MassK0Short) > kshortSelections.kshortWindow) && kshortSelections.kshortWindow > 0)
501+
if ((std::abs(kshort.mK0Short() - o2::constants::physics::MassK0Short) > kshortSelections.kshortWindow) && kshortSelections.kshortWindow > 0)
502502
return false;
503503

504504
histos.fill(HIST("KShortSel/hSelectionStatistics"), 2.);
@@ -514,7 +514,7 @@ struct k892hadronphotonBkg {
514514
return false;
515515

516516
histos.fill(HIST("KShortSel/hSelectionStatistics"), 5.);
517-
if ((TMath::Abs(kshort.dcapostopv()) < kshortSelections.kshortMinDCAPosToPv) || (TMath::Abs(kshort.dcanegtopv()) < kshortSelections.kshortMinDCANegToPv))
517+
if ((std::abs(kshort.dcapostopv()) < kshortSelections.kshortMinDCAPosToPv) || (std::abs(kshort.dcanegtopv()) < kshortSelections.kshortMinDCANegToPv))
518518
return false;
519519

520520
histos.fill(HIST("KShortSel/hSelectionStatistics"), 6.);
@@ -526,11 +526,11 @@ struct k892hadronphotonBkg {
526526
return false;
527527

528528
histos.fill(HIST("KShortSel/hSelectionStatistics"), 8.);
529-
if (TMath::Abs(kshort.dcaV0daughters()) > kshortSelections.kshortMaxDCAV0Dau)
529+
if (std::abs(kshort.dcaV0daughters()) > kshortSelections.kshortMaxDCAV0Dau)
530530
return false;
531531

532532
histos.fill(HIST("KShortSel/hSelectionStatistics"), 9.);
533-
if (kshort.qtarm() < kshortSelections.kshortArmenterosCoefficient * TMath::Abs(kshort.alpha()))
533+
if (kshort.qtarm() < kshortSelections.kshortArmenterosCoefficient * std::abs(kshort.alpha()))
534534
return false;
535535

536536
histos.fill(HIST("KShortSel/hSelectionStatistics"), 10.);
@@ -561,8 +561,8 @@ struct k892hadronphotonBkg {
561561

562562
histos.fill(HIST("KShortSel/hSelectionStatistics"), 14.);
563563
// TPC PID selection on the K0S pion daughters (same convention as posTrackKShort.tpcNSigmaPi())
564-
if (((TMath::Abs(posTrackKShort.tpcNSigmaPi()) > kshortSelections.kshortMaxTPCNSigmas) ||
565-
(TMath::Abs(negTrackKShort.tpcNSigmaPi()) > kshortSelections.kshortMaxTPCNSigmas)))
564+
if (((std::abs(posTrackKShort.tpcNSigmaPi()) > kshortSelections.kshortMaxTPCNSigmas) ||
565+
(std::abs(negTrackKShort.tpcNSigmaPi()) > kshortSelections.kshortMaxTPCNSigmas)))
566566
return false;
567567

568568
histos.fill(HIST("KShortSel/hSelectionStatistics"), 15.);

0 commit comments

Comments
 (0)