Skip to content

Commit 1c4650f

Browse files
committed
[PWGLF] Apply O2 linter
1 parent e944e54 commit 1c4650f

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

PWGLF/Tasks/Resonances/f0980analysis.cxx

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "Common/DataModel/EventSelection.h"
1818
#include "Common/DataModel/PIDResponse.h"
1919

20+
#include "CommonConstants/MathConstants.h"
2021
#include "CommonConstants/PhysicsConstants.h"
2122
#include "DataFormatsParameters/GRPObject.h"
2223
#include "Framework/ASoAHelpers.h"
@@ -25,14 +26,8 @@
2526
#include <Framework/Configurable.h>
2627

2728
#include "TVector2.h"
28-
#include <TLorentzVector.h>
29-
#include <vector>
3029

31-
using namespace o2;
32-
using namespace o2::framework;
33-
using namespace o2::framework::expressions;
34-
using namespace o2::soa;
35-
using namespace o2::constants::physics;
30+
#include <vector>
3631

3732
struct f0980analysis {
3833
SliceCache cache;
@@ -98,9 +93,9 @@ struct f0980analysis {
9893

9994
AxisSpec PIDqaAxis = {120, -6, 6};
10095
AxisSpec pTqaAxis = {200, 0, 20};
101-
AxisSpec phiqaAxis = {72, 0., 2.0 * constants::math::PI};
102-
AxisSpec EPAxis = {10, 0, constants::math::PI};
103-
AxisSpec EPqaAxis = {200, -constants::math::PI, constants::math::PI};
96+
AxisSpec phiqaAxis = {72, 0., 2.0 * o2::constants::math::PI};
97+
AxisSpec EPAxis = {10, 0, o2::constants::math::PI};
98+
AxisSpec EPqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI};
10499
AxisSpec EPresAxis = {200, -2, 2};
105100

106101
if (cfgFindRT) {
@@ -144,11 +139,11 @@ struct f0980analysis {
144139
int RTIndex(double pairphi, double lhphi)
145140
{
146141
double dphi = std::fabs(TVector2::Phi_mpi_pi(lhphi - pairphi));
147-
if (dphi < constants::math::PI / 3.0)
142+
if (dphi < o2::constants::math::PI / 3.0)
148143
return 0;
149-
if (dphi < 2.0 * constants::math::PI / 3.0 && dphi > constants::math::PI / 3.0)
144+
if (dphi < 2.0 * o2::constants::math::PI / 3.0 && dphi > o2::constants::math::PI / 3.0)
150145
return 1;
151-
if (dphi > 2.0 * constants::math::PI / 3.0)
146+
if (dphi > 2.0 * o2::constants::math::PI / 3.0)
152147
return 2;
153148

154149
return -1;
@@ -234,7 +229,7 @@ struct f0980analysis {
234229
histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResAC());
235230
histos.fill(HIST("QA/LTpt"), LHpt, collision.cent(), LHphi);
236231

237-
TLorentzVector Pion1, Pion2, Reco;
232+
ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float>> Pion1, Pion2, Reco;
238233
for (auto& [trk1, trk2] :
239234
combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) {
240235

@@ -256,8 +251,8 @@ struct f0980analysis {
256251
continue;
257252

258253
relPhi = TVector2::Phi_0_2pi(Reco.Phi() - collision.evtPl());
259-
if (relPhi > constants::math::PI) {
260-
relPhi -= constants::math::PI;
254+
if (relPhi > o2::constants::math::PI) {
255+
relPhi -= o2::constants::math::PI;
261256
}
262257

263258
if (trk1.sign() * trk2.sign() < 0) {
@@ -268,11 +263,11 @@ struct f0980analysis {
268263
histos.fill(HIST("hInvMass_f0980_US_EPA"), Reco.M(), Reco.Pt(),
269264
collision.cent(), relPhi);
270265
if constexpr (IsMC) {
271-
if (abs(trk1.pdgCode()) != 211 || abs(trk2.pdgCode()) != 211)
266+
if (std::abs(trk1.pdgCode()) != 211 || std::abs(trk2.pdgCode()) != 211)
272267
continue;
273268
if (trk1.motherId() != trk2.motherId())
274269
continue;
275-
if (abs(trk1.motherPDG()) != 9010221)
270+
if (std::abs(trk1.motherPDG()) != 9010221)
276271
continue;
277272
histos.fill(HIST("MCL/hpT_f0980_REC"), Reco.M(), Reco.Pt(),
278273
collision.cent());
@@ -313,16 +308,16 @@ struct f0980analysis {
313308
void processMCTrue(aod::ResoMCParents& resoParents)
314309
{
315310
for (auto& part : resoParents) { // loop over all pre-filtered MC particles
316-
if (abs(part.pdgCode()) != 9010221)
311+
if (std::abs(part.pdgCode()) != 9010221)
317312
continue;
318313
if (!part.producedByGenerator())
319314
continue;
320315
if (part.y() < cfgMinRap || part.y() > cfgMaxRap) {
321316
continue;
322317
}
323318
bool pass = false;
324-
if ((abs(part.daughterPDG1()) == 211 &&
325-
abs(part.daughterPDG2()) == 211)) {
319+
if ((std::abs(part.daughterPDG1()) == 211 &&
320+
std::abs(part.daughterPDG2()) == 211)) {
326321
pass = true;
327322
}
328323
if (!pass) // If we have both decay products

0 commit comments

Comments
 (0)