Skip to content

Commit 514fd94

Browse files
[PWGCF] PDG linter error fix and correction in Filter check (#10530)
1 parent 3c83125 commit 514fd94

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct AntiprotonCumulantsMc {
117117

118118
// Filter command for rec (data)***********
119119
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
120-
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5.0f) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (aod::track::dcaZ < cfgCutDCAz) && (aod::track::dcaXY < cfgCutDCAxy);
120+
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5.0f) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::dcaXY) < cfgCutDCAxy);
121121

122122
// filtering collisions and tracks for real data***********
123123
using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFDDMs>>;
@@ -946,7 +946,7 @@ struct AntiprotonCumulantsMc {
946946
int nchInel = 0;
947947
for (const auto& mcParticle : mcParticles) {
948948
auto pdgcode = std::abs(mcParticle.pdgCode());
949-
if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) {
949+
if (mcParticle.isPhysicalPrimary() && (pdgcode == PDG_t::kPiPlus || pdgcode == PDG_t::kKPlus || pdgcode == PDG_t::kProton || pdgcode == PDG_t::kElectron || pdgcode == PDG_t::kMuonMinus)) {
950950
if (std::abs(mcParticle.eta()) < 1.0) {
951951
nchInel = nchInel + 1;
952952
}
@@ -992,17 +992,15 @@ struct AntiprotonCumulantsMc {
992992
for (const auto& mcParticle : mcParticles) {
993993
if (!mcParticle.has_mcCollision())
994994
continue;
995-
if (!(mcParticle.mcCollision().globalIndex() == mcCollision.globalIndex()))
996-
continue;
997995

998996
if (mcParticle.isPhysicalPrimary()) {
999997
if ((mcParticle.pt() > cfgCutPtLower) && (mcParticle.pt() < 5.0f) && (std::abs(mcParticle.eta()) < cfgCutEta)) {
1000998
histos.fill(HIST("hgenPtAll"), mcParticle.pt());
1001999
histos.fill(HIST("hgenEtaAll"), mcParticle.eta());
10021000
histos.fill(HIST("hgenPhiAll"), mcParticle.phi());
10031001

1004-
if (std::abs(mcParticle.pdgCode()) == 2212 /*&& std::abs(mcParticle.y()) < 0.5*/) {
1005-
if (mcParticle.pdgCode() == 2212) {
1002+
if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton /*&& std::abs(mcParticle.y()) < 0.5*/) {
1003+
if (mcParticle.pdgCode() == PDG_t::kProton) {
10061004
histos.fill(HIST("hgenPtProton"), mcParticle.pt()); //! hist for p gen
10071005
histos.fill(HIST("hgenPtDistProtonVsCentrality"), mcParticle.pt(), cent);
10081006
histos.fill(HIST("hgen2DEtaVsPtProton"), mcParticle.pt(), mcParticle.eta());
@@ -1011,7 +1009,7 @@ struct AntiprotonCumulantsMc {
10111009
if (mcParticle.pt() < cfgCutPtUpper)
10121010
nProt = nProt + 1.0;
10131011
}
1014-
if (mcParticle.pdgCode() == -2212) {
1012+
if (mcParticle.pdgCode() == PDG_t::kProtonBar) {
10151013
histos.fill(HIST("hgenPtAntiproton"), mcParticle.pt()); //! hist for anti-p gen
10161014
histos.fill(HIST("hgenPtDistAntiprotonVsCentrality"), mcParticle.pt(), cent);
10171015
histos.fill(HIST("hgen2DEtaVsPtAntiproton"), mcParticle.pt(), mcParticle.eta());
@@ -1104,9 +1102,6 @@ struct AntiprotonCumulantsMc {
11041102
if (!track.has_collision()) {
11051103
continue;
11061104
}
1107-
if (!(track.collision().globalIndex() == collision.globalIndex())) {
1108-
continue;
1109-
}
11101105

11111106
if (!track.has_mcParticle()) //! check if track has corresponding MC particle
11121107
{
@@ -1181,7 +1176,7 @@ struct AntiprotonCumulantsMc {
11811176
}
11821177
}
11831178
}
1184-
if (particle.pdgCode() == 2212) {
1179+
if (particle.pdgCode() == PDG_t::kProton) {
11851180
histos.fill(HIST("hrecTruePtProton"), particle.pt()); //! hist for p purity
11861181
}
11871182
}
@@ -1203,7 +1198,7 @@ struct AntiprotonCumulantsMc {
12031198
}
12041199
}
12051200
}
1206-
if (particle.pdgCode() == -2212) {
1201+
if (particle.pdgCode() == PDG_t::kProtonBar) {
12071202
histos.fill(HIST("hrecTruePtAntiproton"), particle.pt()); //! hist for anti-p purity
12081203
}
12091204
}
@@ -2055,9 +2050,7 @@ struct AntiprotonCumulantsMc {
20552050
if (!track.has_collision()) {
20562051
continue;
20572052
}
2058-
if (!(track.collision().globalIndex() == coll.globalIndex())) {
2059-
continue;
2060-
}
2053+
20612054
if (!track.isPVContributor()) //! track check as used in data
20622055
{
20632056
continue;

PWGCF/EbyEFluctuations/Tasks/netprotonCumulantsMc.cxx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct NetprotonCumulantsMc {
117117

118118
// Filter command for rec (data)***********
119119
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
120-
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5.0f) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (aod::track::dcaZ < cfgCutDCAz) && (aod::track::dcaXY < cfgCutDCAxy);
120+
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5.0f) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::dcaXY) < cfgCutDCAxy);
121121

122122
// filtering collisions and tracks for real data***********
123123
using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFDDMs>>;
@@ -946,7 +946,7 @@ struct NetprotonCumulantsMc {
946946
int nchInel = 0;
947947
for (const auto& mcParticle : mcParticles) {
948948
auto pdgcode = std::abs(mcParticle.pdgCode());
949-
if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) {
949+
if (mcParticle.isPhysicalPrimary() && (pdgcode == PDG_t::kPiPlus || pdgcode == PDG_t::kKPlus || pdgcode == PDG_t::kProton || pdgcode == PDG_t::kElectron || pdgcode == PDG_t::kMuonMinus)) {
950950
if (std::abs(mcParticle.eta()) < 1.0) {
951951
nchInel = nchInel + 1;
952952
}
@@ -992,17 +992,15 @@ struct NetprotonCumulantsMc {
992992
for (const auto& mcParticle : mcParticles) {
993993
if (!mcParticle.has_mcCollision())
994994
continue;
995-
if (!(mcParticle.mcCollision().globalIndex() == mcCollision.globalIndex()))
996-
continue;
997995

998996
if (mcParticle.isPhysicalPrimary()) {
999997
if ((mcParticle.pt() > cfgCutPtLower) && (mcParticle.pt() < 5.0f) && (std::abs(mcParticle.eta()) < cfgCutEta)) {
1000998
histos.fill(HIST("hgenPtAll"), mcParticle.pt());
1001999
histos.fill(HIST("hgenEtaAll"), mcParticle.eta());
10021000
histos.fill(HIST("hgenPhiAll"), mcParticle.phi());
10031001

1004-
if (std::abs(mcParticle.pdgCode()) == 2212 /*&& std::abs(mcParticle.y()) < 0.5*/) {
1005-
if (mcParticle.pdgCode() == 2212) {
1002+
if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton /*&& std::abs(mcParticle.y()) < 0.5*/) {
1003+
if (mcParticle.pdgCode() == PDG_t::kProton) {
10061004
histos.fill(HIST("hgenPtProton"), mcParticle.pt()); //! hist for p gen
10071005
histos.fill(HIST("hgenPtDistProtonVsCentrality"), mcParticle.pt(), cent);
10081006
histos.fill(HIST("hgen2DEtaVsPtProton"), mcParticle.pt(), mcParticle.eta());
@@ -1011,7 +1009,7 @@ struct NetprotonCumulantsMc {
10111009
if (mcParticle.pt() < cfgCutPtUpper)
10121010
nProt = nProt + 1.0;
10131011
}
1014-
if (mcParticle.pdgCode() == -2212) {
1012+
if (mcParticle.pdgCode() == PDG_t::kProtonBar) {
10151013
histos.fill(HIST("hgenPtAntiproton"), mcParticle.pt()); //! hist for anti-p gen
10161014
histos.fill(HIST("hgenPtDistAntiprotonVsCentrality"), mcParticle.pt(), cent);
10171015
histos.fill(HIST("hgen2DEtaVsPtAntiproton"), mcParticle.pt(), mcParticle.eta());
@@ -1104,9 +1102,7 @@ struct NetprotonCumulantsMc {
11041102
if (!track.has_collision()) {
11051103
continue;
11061104
}
1107-
if (!(track.collision().globalIndex() == collision.globalIndex())) {
1108-
continue;
1109-
}
1105+
11101106
if (!track.has_mcParticle()) //! check if track has corresponding MC particle
11111107
{
11121108
continue;
@@ -1179,7 +1175,7 @@ struct NetprotonCumulantsMc {
11791175
}
11801176
}
11811177
}
1182-
if (particle.pdgCode() == 2212) {
1178+
if (particle.pdgCode() == PDG_t::kProton) {
11831179
histos.fill(HIST("hrecTruePtProton"), particle.pt()); //! hist for p purity
11841180
}
11851181
}
@@ -1201,7 +1197,7 @@ struct NetprotonCumulantsMc {
12011197
}
12021198
}
12031199
}
1204-
if (particle.pdgCode() == -2212) {
1200+
if (particle.pdgCode() == PDG_t::kProtonBar) {
12051201
histos.fill(HIST("hrecTruePtAntiproton"), particle.pt()); //! hist for anti-p purity
12061202
}
12071203
}
@@ -2053,9 +2049,7 @@ struct NetprotonCumulantsMc {
20532049
if (!track.has_collision()) {
20542050
continue;
20552051
}
2056-
if (!(track.collision().globalIndex() == coll.globalIndex())) {
2057-
continue;
2058-
}
2052+
20592053
if (!track.isPVContributor()) //! track check as used in data
20602054
{
20612055
continue;

0 commit comments

Comments
 (0)