[PWGJE] Replace TMath methods with O2 ones#12353
[PWGJE] Replace TMath methods with O2 ones#12353vkucera merged 2 commits intoAliceO2Group:masterfrom
Conversation
|
O2 linter results: ❌ 51 errors, |
vkucera
left a comment
There was a problem hiding this comment.
Hi @arvindkhuntia , thanks for the improvements.
Do you plan to fix the PDG codes in the rest of the code in this PR as well?
Please see my comments below.
PWGJE/Tasks/nucleiInJets.cxx
Outdated
| static constexpr int PDGDeuteron = o2::constants::physics::Pdg::kDeuteron; | ||
| static constexpr int PDGTriton = o2::constants::physics::Pdg::kTriton; | ||
| static constexpr int PDGHelium = o2::constants::physics::Pdg::kHelium3; |
There was a problem hiding this comment.
Use the existing PDG code names directly. Also for kProton.
There was a problem hiding this comment.
Hi @vkucera,
These constants are not used in the task. Removed them from the task. Thank you.
There was a problem hiding this comment.
But they should be used in mapPDGToValue.
There was a problem hiding this comment.
Indeed. I will fix this in my next PR.
| jetHist.fill(HIST("tracks/proton/h2TOFmass2ProtonVsPt_jet"), massTOF * massTOF - gMassProton * gMassProton, trk.pt()); | ||
| jetHist.fill(HIST("tracks/proton/h2TOFmass2ProtonVsPt_jet"), massTOF * massTOF - o2::constants::physics::MassProton * o2::constants::physics::MassProton, trk.pt()); |
There was a problem hiding this comment.
You can put
using namespace o2::constants::physics;in your task to avoid spelling the prefix every time.
There was a problem hiding this comment.
Thanks for the suggestion. I will fix this in the next PR.
Co-authored-by: Arvind Khuntia <arvind.khuntia@cern.ch>
Co-authored-by: Arvind Khuntia <arvind.khuntia@cern.ch>
Co-authored-by: Arvind Khuntia <arvind.khuntia@cern.ch>
Dear @nzardosh,
I have removed TMath dependency and tried to solve some of the issues related to the O2 linter in this PR (Thanks to @vkucera for suggestions). Please approve the PR once tests are passed.
Have a nice afternoon.