Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions PWGLF/TableProducer/Nuspex/ebyeMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#include "PWGLF/DataModel/LFEbyeTables.h"

#include "TDatabasePDG.h"

Check warning on line 47 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Direct use of TDatabasePDG is not allowed. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG>.
#include "TFormula.h"

using namespace o2;
Expand Down Expand Up @@ -320,18 +320,17 @@
Preslice<aod::V0s> perCollisionV0 = o2::aod::v0::collisionId;
Preslice<aod::McParticles> perCollisionMcParts = o2::aod::mcparticle::mcCollisionId;

template<class P>
template <class P>
int getPartTypeMother(P const& mcPart)
{
for (auto& mother : mcPart.template mothers_as<aod::McParticles>()) {

Check warning on line 326 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!mother.isPhysicalPrimary())
return -1;
int pdgCode = mother.pdgCode();
switch (std::abs(pdgCode)) {
case 3122:
{
case 3122: {
int foundPi = 0;
for (auto& mcDaught : mother.template daughters_as<aod::McParticles>()) {

Check warning on line 333 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (std::abs(mcDaught.pdgCode()) == 211) {
foundPi = mcDaught.pdgCode();
break;
Expand Down Expand Up @@ -532,17 +531,17 @@
auto fv0c = fv0cs.rawIteratorAt(id);
float multFV0A = 0;
float multFV0C = 0;
for (float amplitude : fv0a.amplitude()) {

Check warning on line 534 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
multFV0A += amplitude;
}

for (float amplitude : fv0c.amplitude()) {

Check warning on line 538 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
multFV0C += amplitude;
}

float v0m = -1;
auto scaleMC = [](float x, float pars[6]) {
return pow(((pars[0] + pars[1] * pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]);

Check warning on line 544 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
};

if (Run2V0MInfo.mMCScale != nullptr) {
Expand Down Expand Up @@ -911,7 +910,7 @@
fillRecoEvent<C, T>(collision, tracks, V0s, centrality);

for (int iP{0}; iP < kNpart; ++iP) {
for (auto& candidateTrack : candidateTracks[iP]) {

Check warning on line 913 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
candidateTrack.isreco = true;

auto mcLab = mcLabels.rawIteratorAt(candidateTrack.globalIndex);
Expand All @@ -928,8 +927,10 @@

if (!mcTrack.isPhysicalPrimary() && !doprocessMiniMcRun2)
continue;
if (mcTrack.isPhysicalPrimary()) candidateTrack.pdgcodemoth = PartTypes::kPhysPrim;
else if (mcTrack.has_mothers() && iP == 0) candidateTrack.pdgcodemoth = getPartTypeMother(mcTrack);
if (mcTrack.isPhysicalPrimary())
candidateTrack.pdgcodemoth = PartTypes::kPhysPrim;
else if (mcTrack.has_mothers() && iP == 0)
candidateTrack.pdgcodemoth = getPartTypeMother(mcTrack);

auto genPt = std::hypot(mcTrack.px(), mcTrack.py());
candidateTrack.pdgcode = mcTrack.pdgCode();
Expand All @@ -939,7 +940,7 @@
}
}
}
for (auto& candidateV0 : candidateV0s) {

Check warning on line 943 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
candidateV0.isreco = true;
auto mcLabPos = mcLabels.rawIteratorAt(candidateV0.globalIndexPos);
auto mcLabNeg = mcLabels.rawIteratorAt(candidateV0.globalIndexNeg);
Expand All @@ -948,8 +949,8 @@
auto mcTrackPos = mcLabPos.template mcParticle_as<aod::McParticles>();
auto mcTrackNeg = mcLabNeg.template mcParticle_as<aod::McParticles>();
if (mcTrackPos.has_mothers() && mcTrackNeg.has_mothers()) {
for (auto& negMother : mcTrackNeg.template mothers_as<aod::McParticles>()) {

Check warning on line 952 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
for (auto& posMother : mcTrackPos.template mothers_as<aod::McParticles>()) {

Check warning on line 953 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (posMother.globalIndex() != negMother.globalIndex())
continue;
if (!((mcTrackPos.pdgCode() == 2212 && mcTrackNeg.pdgCode() == -211) || (mcTrackPos.pdgCode() == 211 && mcTrackNeg.pdgCode() == -2212)))
Expand Down Expand Up @@ -1022,8 +1023,10 @@
candTrack.genpt = genPt;
candTrack.geneta = mcPart.eta();
candTrack.pdgcode = pdgCode;
if (mcPart.isPhysicalPrimary()) candTrack.pdgcodemoth = PartTypes::kPhysPrim;
else if (mcPart.has_mothers() && iP == 0) candTrack.pdgcodemoth = getPartTypeMother(mcPart);
if (mcPart.isPhysicalPrimary())
candTrack.pdgcodemoth = PartTypes::kPhysPrim;
else if (mcPart.has_mothers() && iP == 0)
candTrack.pdgcodemoth = getPartTypeMother(mcPart);

auto it = find_if(candidateTracks[iP].begin(), candidateTracks[iP].end(), [&](CandidateTrack trk) { return trk.mcIndex == mcPart.globalIndex(); });
if (it != candidateTracks[iP].end()) {
Expand Down Expand Up @@ -1436,11 +1439,11 @@
// continue;
if (candidateTrack.pdgcodemoth > 0)
selMask |= candidateTrack.pdgcodemoth;
}
else if (candidateTrack.pdgcodemoth > 0){
} else if (candidateTrack.pdgcodemoth > 0) {
selMask = candidateTrack.pdgcodemoth;
}
if (selMask < 0) continue;
if (selMask < 0)
continue;
mcMiniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
Expand Down
Loading