Skip to content

Commit f80fc8d

Browse files
committed
Fix linter and code-check warnings
1 parent 2bdb25d commit f80fc8d

1 file changed

Lines changed: 43 additions & 43 deletions

File tree

PWGCF/TwoParticleCorrelations/Tasks/lambdaOrAntiLambdaProducerWithSpin.cxx

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
///
12-
/// \brief Step2 of the LambdaOrAntiLambdaProducerWithSpin.cxx
13-
/// \author Akash Raj (akash.raj.john.babu@cern.ch)
1411

12+
/// \file lambdaOrAntiLambdaProducerWithSpin.cxx
13+
/// \brief Produces Lambda and anti-Lambda candidates and analyzes their spin correlations
14+
/// \author Akash Raj (akash.raj.john.babu@cern.ch)
1515

1616
#include "PWGLF/DataModel/LFStrangenessTables.h"
1717

@@ -20,27 +20,28 @@
2020
#include "Common/DataModel/Multiplicity.h"
2121
#include "Common/DataModel/PIDResponseTPC.h"
2222

23-
#include <CommonConstants/PhysicsConstants.h>
23+
#include "CommonConstants/PhysicsConstants.h"
2424
#include <CommonConstants/MathConstants.h>
25+
#include <CommonConstants/PhysicsConstants.h>
2526
#include <Framework/ASoA.h>
27+
#include <Framework/ASoAHelpers.h>
2628
#include <Framework/AnalysisDataModel.h>
29+
#include <Framework/AnalysisHelpers.h>
2730
#include <Framework/AnalysisTask.h>
2831
#include <Framework/Configurable.h>
2932
#include <Framework/Expressions.h>
3033
#include <Framework/HistogramRegistry.h>
3134
#include <Framework/HistogramSpec.h>
3235
#include <Framework/InitContext.h>
3336
#include <Framework/OutputObjHeader.h>
34-
#include <Framework/ASoAHelpers.h>
35-
#include <Framework/AnalysisHelpers.h>
36-
37-
#include <TH1.h>
38-
#include <TPDGCode.h>
39-
#include <TString.h>
4037

4138
#include <Math/GenVector/Boost.h>
4239
#include <Math/Vector4D.h>
40+
#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
4341
#include <Math/Vector4Dfwd.h>
42+
#include <TH1.h>
43+
#include <TPDGCode.h>
44+
#include <TString.h>
4445

4546
#include <cmath>
4647
#include <cstdint>
@@ -429,7 +430,7 @@ struct LambdaOrAntiLambdaProducerWithSpin {
429430
// rLambdaOrAntiLambda.add("Candidate/hPt", "V0 p_{T};p_{T} (GeV/c);entries", HistType::kTH1F, {{200, 0.f, 10.f}});
430431
rLambdaOrAntiLambda.add("Candidate/hPt", "V0 p_{T};p_{T} (GeV/c);entries", HistType::kTH1F, {axisLambdaAntiLambdaPt});
431432
rLambdaOrAntiLambda.add("Candidate/hEta", "V0 pseudorapidity;#eta;entries", HistType::kTH1F, {{100, -2.f, 2.f}});
432-
rLambdaOrAntiLambda.add("Candidate/hPhi", "V0 azimuth;#varphi;entries", HistType::kTH1F, {{72, 0.f, 2.f * M_PI}});
433+
rLambdaOrAntiLambda.add("Candidate/hPhi", "V0 azimuth;#varphi;entries", HistType::kTH1F, {{72, 0.f, o2::constants::math::TwoPI}});
433434
rLambdaOrAntiLambda.add("Candidate/hRapidity", "V0 rapidity;y;entries", HistType::kTH1F, {{100, -2.f, 2.f}});
434435
rLambdaOrAntiLambda.add("Candidate/hMass", "Reconstructed invariant mass;m_{p#pi} (GeV/c^{2});entries", HistType::kTH1F, {axisInvariantMass});
435436
rLambdaOrAntiLambda.add("Candidate/hMassVsPt",
@@ -453,7 +454,7 @@ struct LambdaOrAntiLambdaProducerWithSpin {
453454
rLambdaOrAntiLambda.add("Proton/hPz", "Proton/antiproton p_{z};p_{z} (GeV/c);entries", HistType::kTH1F, {{200, -10.f, 10.f}});
454455
rLambdaOrAntiLambda.add("Proton/hPt", "Proton/antiproton p_{T};p_{T} (GeV/c);entries", HistType::kTH1F, {{200, 0.f, 5.f}});
455456
rLambdaOrAntiLambda.add("Proton/hEta", "Proton/antiproton pseudorapidity;#eta;entries", HistType::kTH1F, {{100, -2.f, 2.f}});
456-
rLambdaOrAntiLambda.add("Proton/hPhi", "Proton/antiproton azimuth;#varphi;entries", HistType::kTH1F, {{72, 0.f, 2.f * M_PI}});
457+
rLambdaOrAntiLambda.add("Proton/hPhi", "Proton/antiproton azimuth;#varphi;entries", HistType::kTH1F, {{72, 0.f, o2::constants::math::TwoPI}});
457458
rLambdaOrAntiLambda.add("Proton/hDcaToPV", "Proton/antiproton DCA to PV;DCA (cm);entries", HistType::kTH1F, {{200, 0.f, 10.f}});
458459

459460
// Pion
@@ -464,7 +465,7 @@ struct LambdaOrAntiLambdaProducerWithSpin {
464465
rLambdaOrAntiLambda.add("Pion/hPz", "Pion p_{z};p_{z} (GeV/c);entries", HistType::kTH1F, {{200, -10.f, 10.f}});
465466
rLambdaOrAntiLambda.add("Pion/hPt", "Pion p_{T};p_{T} (GeV/c);entries", HistType::kTH1F, {{200, 0.f, 5.f}});
466467
rLambdaOrAntiLambda.add("Pion/hEta", "Pion pseudorapidity;#eta;entries", HistType::kTH1F, {{100, -2.f, 2.f}});
467-
rLambdaOrAntiLambda.add("Pion/hPhi", "Pion azimuth;#varphi;entries", HistType::kTH1F, {{72, 0.f, 2.f * M_PI}});
468+
rLambdaOrAntiLambda.add("Pion/hPhi", "Pion azimuth;#varphi;entries", HistType::kTH1F, {{72, 0.f, o2::constants::math::TwoPI}});
468469
rLambdaOrAntiLambda.add("Pion/hDcaToPV", "Pion DCA to PV;DCA (cm);entries", HistType::kTH1F, {{200, 0.f, 10.f}});
469470

470471
// Armenteros-Podolanski
@@ -1299,7 +1300,7 @@ struct LambdaAntiLambdaEfficiencyPlots {
12991300
const auto particlesFromThisMcCollision = allMcParticles.sliceBy(mcParticlesPerMcCollision, selectedMcEvent.mcCollisionId());
13001301

13011302
// Reconstructed-collision-opportunity weight
1302-
const float weight = static_cast<float>(selectedMcEvent.nSel8Collisions());
1303+
const auto weight = static_cast<float>(selectedMcEvent.nSel8Collisions());
13031304

13041305
for (const auto& particle : particlesFromThisMcCollision) {
13051306

@@ -1485,12 +1486,12 @@ struct LambdaAntiLambdaPairAnalysis {
14851486
HistogramRegistry rSpinAnalysis{"SpinPairAnalysis", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
14861487
// defining Axis for histograms
14871488
ConfigurableAxis axisDeltaEta{"axisDeltaEta", {100, -2.f, 2.f}, "#Delta#eta axis"};
1488-
ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -M_PI, M_PI}, "#Delta#phi axis"};
1489+
ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -o2::constants::math::PI, o2::constants::math::PI}, "#Delta#phi axis"};
14891490
ConfigurableAxis axisDeltaPt{"axisDeltaPt", {400, -10.f, 10.f}, "#Delta#p_{T} axis"};
14901491

14911492
ConfigurableAxis axisPt{"axisPt", {200, 0.f, 10.f}, "transverse-momentum axis"};
14921493
ConfigurableAxis axisEta{"axisEta", {100, -2.f, 2.f}, "#eta axis"};
1493-
ConfigurableAxis axisPhi{"axisPhi", {72, 0, 2 * M_PI}, "#phi axis"};
1494+
ConfigurableAxis axisPhi{"axisPhi", {72, 0, o2::constants::math::TwoPI}, "#phi axis"};
14941495

14951496
ConfigurableAxis axisInvariantMass{"axisInvariantMass", {100, 1.08f, 1.2f}, "Invariant-mass axis"};
14961497
ConfigurableAxis axisDeltaMass{"axisDeltaMass", {100, -0.12f, 0.12f}, "Invariant-mass axis"};
@@ -1673,24 +1674,23 @@ struct LambdaAntiLambdaPairAnalysis {
16731674
return protonStar;
16741675
}
16751676

1676-
float CosTheta(ROOT::Math::PxPyPzMVector proton1, ROOT::Math::PxPyPzMVector proton2)
1677+
float cosTheta(ROOT::Math::PxPyPzMVector const& proton1,
1678+
ROOT::Math::PxPyPzMVector const& proton2)
16771679
{
1678-
float numerator = (proton1.Px() * proton2.Px() + proton1.Py() * proton2.Py() + proton1.Pz() * proton2.Pz());
1679-
float denominator = (proton1.P() * proton2.P());
1680-
float cosTheta;
1680+
const float numerator = proton1.Px() * proton2.Px() + proton1.Py() * proton2.Py() + proton1.Pz() * proton2.Pz();
1681+
const float denominator = proton1.P() * proton2.P();
1682+
16811683
if (denominator == 0.f) {
1682-
cosTheta = -2;
1683-
} else {
1684-
cosTheta = numerator / denominator;
1684+
return -2.f;
16851685
}
1686-
return cosTheta;
1686+
return numerator / denominator;
16871687
}
16881688

16891689
template <typename Candidate1, typename Candidate2>
16901690
bool isKinematicallyCompatible(Candidate1 const& candidate1, Candidate2 const& candidate2)
16911691
{
16921692
const float deltaPt = std::abs(candidate1.pt() - candidate2.pt());
1693-
const float deltaPhi = std::abs(std::remainder(candidate1.phi() - candidate2.phi(), 2.f * M_PI));
1693+
const float deltaPhi = std::abs(std::remainder(candidate1.phi() - candidate2.phi(), o2::constants::math::TwoPI));
16941694
const float deltaRapidity = std::abs(candidate1.rapidity() - candidate2.rapidity());
16951695

16961696
return deltaPt < compatibilityDeltaPt &&
@@ -1703,7 +1703,7 @@ struct LambdaAntiLambdaPairAnalysis {
17031703
{
17041704
const float deltaRapidity = std::abs(candidate1.rapidity() - candidate2.rapidity());
17051705

1706-
const float deltaPhi = std::abs(std::remainder(candidate1.phi() - candidate2.phi(), 2.f * static_cast<float>(M_PI)));
1706+
const float deltaPhi = std::abs(std::remainder(candidate1.phi() - candidate2.phi(), o2::constants::math::TwoPI));
17071707

17081708
return deltaRapidity < sameEventShortRangePairMaxDeltaRapidity &&
17091709
deltaPhi < sameEventShortRangePairMaxDeltaPhi;
@@ -1725,8 +1725,8 @@ struct LambdaAntiLambdaPairAnalysis {
17251725
// Boost the antiproton into the anti-Lambda rest frame.
17261726
const auto antiProtonStar = daughterInParentRestFrame(antiLambda.px(), antiLambda.py(), antiLambda.pz(), antiLambda.mass(), antiLambda.protonPx(), antiLambda.protonPy(), antiLambda.protonPz(), o2::constants::physics::MassProton);
17271727

1728-
const float cosDeltaThetaStar = CosTheta(protonStar, antiProtonStar);
1729-
const float deltaPhi = std::remainder(lambda.phi() - antiLambda.phi(), 2.f * M_PI);
1728+
const float cosDeltaThetaStar = cosTheta(protonStar, antiProtonStar);
1729+
const float deltaPhi = std::remainder(lambda.phi() - antiLambda.phi(), o2::constants::math::TwoPI);
17301730
// Invalid result returned by cosTheta().
17311731
if (cosDeltaThetaStar < -1.f) {
17321732
continue;
@@ -1786,8 +1786,8 @@ struct LambdaAntiLambdaPairAnalysis {
17861786
// Boost the antiproton into the anti-Lambda rest frame.
17871787
const auto protonStar2 = daughterInParentRestFrame(lambda2.px(), lambda2.py(), lambda2.pz(), lambda2.mass(), lambda2.protonPx(), lambda2.protonPy(), lambda2.protonPz(), o2::constants::physics::MassProton);
17881788

1789-
const float cosDeltaThetaStar = CosTheta(protonStar1, protonStar2);
1790-
const float deltaPhi = std::remainder(lambda1.phi() - lambda2.phi(), 2.f * M_PI);
1789+
const float cosDeltaThetaStar = cosTheta(protonStar1, protonStar2);
1790+
const float deltaPhi = std::remainder(lambda1.phi() - lambda2.phi(), o2::constants::math::TwoPI);
17911791
// Invalid result returned by cosTheta().
17921792
if (cosDeltaThetaStar < -1.f) {
17931793
continue;
@@ -1847,8 +1847,8 @@ struct LambdaAntiLambdaPairAnalysis {
18471847
// Boost the antiproton into the anti-Lambda rest frame.
18481848
const auto antiProtonStar2 = daughterInParentRestFrame(antilambda2.px(), antilambda2.py(), antilambda2.pz(), antilambda2.mass(), antilambda2.protonPx(), antilambda2.protonPy(), antilambda2.protonPz(), o2::constants::physics::MassProton);
18491849

1850-
const float cosDeltaThetaStar = CosTheta(antiProtonStar1, antiProtonStar2);
1851-
const float deltaPhi = std::remainder(antilambda1.phi() - antilambda2.phi(), 2.f * M_PI);
1850+
const float cosDeltaThetaStar = cosTheta(antiProtonStar1, antiProtonStar2);
1851+
const float deltaPhi = std::remainder(antilambda1.phi() - antilambda2.phi(), o2::constants::math::TwoPI);
18521852
// Invalid result returned by cosTheta().
18531853
if (cosDeltaThetaStar < -1.f) {
18541854
continue;
@@ -1907,8 +1907,8 @@ struct LambdaAntiLambdaPairAnalysis {
19071907
// Boost the antiproton into the anti-Lambda rest frame.
19081908
const auto antiProtonStar = daughterInParentRestFrame(antiLambda.px(), antiLambda.py(), antiLambda.pz(), antiLambda.mass(), antiLambda.protonPx(), antiLambda.protonPy(), antiLambda.protonPz(), o2::constants::physics::MassProton);
19091909

1910-
const float cosDeltaThetaStar = CosTheta(protonStar, antiProtonStar);
1911-
const float deltaPhi = std::remainder(lambda.phi() - antiLambda.phi(), 2.f * M_PI);
1910+
const float cosDeltaThetaStar = cosTheta(protonStar, antiProtonStar);
1911+
const float deltaPhi = std::remainder(lambda.phi() - antiLambda.phi(), o2::constants::math::TwoPI);
19121912
// Invalid result returned by cosTheta().
19131913
if (cosDeltaThetaStar < -1.f) {
19141914
continue;
@@ -1952,8 +1952,8 @@ struct LambdaAntiLambdaPairAnalysis {
19521952
// Boost the antiproton into the anti-Lambda rest frame.
19531953
const auto antiProtonStar = daughterInParentRestFrame(antiLambda.px(), antiLambda.py(), antiLambda.pz(), antiLambda.mass(), antiLambda.protonPx(), antiLambda.protonPy(), antiLambda.protonPz(), o2::constants::physics::MassProton);
19541954

1955-
const float cosDeltaThetaStar = CosTheta(protonStar, antiProtonStar);
1956-
const float deltaPhi = std::remainder(lambda.phi() - antiLambda.phi(), 2.f * M_PI);
1955+
const float cosDeltaThetaStar = cosTheta(protonStar, antiProtonStar);
1956+
const float deltaPhi = std::remainder(lambda.phi() - antiLambda.phi(), o2::constants::math::TwoPI);
19571957
// Invalid result returned by cosTheta().
19581958
if (cosDeltaThetaStar < -1.f) {
19591959
continue;
@@ -1997,8 +1997,8 @@ struct LambdaAntiLambdaPairAnalysis {
19971997
// Boost the antiproton into the anti-Lambda rest frame.
19981998
const auto antiProtonStar = daughterInParentRestFrame(lambda2.px(), lambda2.py(), lambda2.pz(), lambda2.mass(), lambda2.protonPx(), lambda2.protonPy(), lambda2.protonPz(), o2::constants::physics::MassProton);
19991999

2000-
const float cosDeltaThetaStar = CosTheta(protonStar, antiProtonStar);
2001-
const float deltaPhi = std::remainder(lambda1.phi() - lambda2.phi(), 2.f * M_PI);
2000+
const float cosDeltaThetaStar = cosTheta(protonStar, antiProtonStar);
2001+
const float deltaPhi = std::remainder(lambda1.phi() - lambda2.phi(), o2::constants::math::TwoPI);
20022002
// Invalid result returned by cosTheta().
20032003
if (cosDeltaThetaStar < -1.f) {
20042004
continue;
@@ -2042,8 +2042,8 @@ struct LambdaAntiLambdaPairAnalysis {
20422042
// Boost the antiproton into the anti-Lambda rest frame.
20432043
const auto antiProtonStar = daughterInParentRestFrame(antiLambda2.px(), antiLambda2.py(), antiLambda2.pz(), antiLambda2.mass(), antiLambda2.protonPx(), antiLambda2.protonPy(), antiLambda2.protonPz(), o2::constants::physics::MassProton);
20442044

2045-
const float cosDeltaThetaStar = CosTheta(protonStar, antiProtonStar);
2046-
const float deltaPhi = std::remainder(antiLambda1.phi() - antiLambda2.phi(), 2.f * M_PI);
2045+
const float cosDeltaThetaStar = cosTheta(protonStar, antiProtonStar);
2046+
const float deltaPhi = std::remainder(antiLambda1.phi() - antiLambda2.phi(), o2::constants::math::TwoPI);
20472047
// Invalid result returned by cosTheta().
20482048
if (cosDeltaThetaStar < -1.f) {
20492049
continue;
@@ -2090,7 +2090,7 @@ struct LambdaAntiLambdaPairAnalysis {
20902090

20912091
void process(CollisionsWithMultiplicity const& collisions, FilteredLambdas const& lambdas, FilteredAntiLambdas const& antiLambdas)
20922092
{
2093-
static constexpr int minimumSameSpeciesCandidates = 2;
2093+
static constexpr int MinimumSameSpeciesCandidates = 2;
20942094

20952095
for (auto const& collision : collisions) {
20962096

@@ -2103,12 +2103,12 @@ struct LambdaAntiLambdaPairAnalysis {
21032103
}
21042104

21052105
// Lambda–Lambda requires at least two Lambdas.
2106-
if (lambdasThisCollision.size() >= minimumSameSpeciesCandidates) {
2106+
if (lambdasThisCollision.size() >= MinimumSameSpeciesCandidates) {
21072107
fillLambdaLambdaSameEvent(lambdasThisCollision);
21082108
}
21092109

21102110
// Anti-Lambda–anti-Lambda requires at least two anti-Lambdas.
2111-
if (antiLambdasThisCollision.size() >= minimumSameSpeciesCandidates) {
2111+
if (antiLambdasThisCollision.size() >= MinimumSameSpeciesCandidates) {
21122112
fillAntiLambdaAntiLambdaSameEvent(antiLambdasThisCollision);
21132113
}
21142114
}

0 commit comments

Comments
 (0)