Skip to content
Closed
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <CCDB/BasicCCDBManager.h>

#include "Math/Vector4D.h"
#include "TLorentzVector.h"

Check failure on line 57 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include "TMath.h"
#include <TPDGCode.h>

Expand Down Expand Up @@ -458,11 +458,11 @@
}

template <typename TrackType>
aod::femtouniverseparticle::CutContainerType PIDBitmask(const TrackType& track)

Check failure on line 461 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
static const o2::track::PID pids[] = {o2::track::PID::Proton, o2::track::PID::Pion, o2::track::PID::Kaon};
aod::femtouniverseparticle::CutContainerType mask = 0u;
for (UInt_t i = 0; i < 3; ++i) {

Check failure on line 465 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 465 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (isNSigmaTPC(trackCuts.getNsigmaTPC(track, pids[i])))
mask |= (1u << i);
if (isNSigmaTOF(track.p(), trackCuts.getNsigmaTOF(track, pids[i]), track.hasTOF()))
Expand Down Expand Up @@ -745,7 +745,7 @@
-999., -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999.,
-999.,
hfHelper.yD0(particle), // getter transRadius
hfHelper.yD0(particle), // getter transRadius
particle.mlProbD0bar()[0], // getter decayVtxX
particle.mlProbD0bar()[1], // getter decayVtxY
particle.mlProbD0bar()[2], // getter decayVtxZ
Expand All @@ -761,10 +761,10 @@
template <bool isD0ML, bool isD0barML, typename ParticleType>
void fillDebugD0D0barMcMl(ParticleType const& particle)
{
int8_t originMcReco = 2; // 0 - prompt, 1 - non-prompt, 2 - default/else
if(particle.originMcRec() == RecoDecay::OriginType::Prompt) {
int8_t originMcReco = 2; // 0 - prompt, 1 - non-prompt, 2 - default/else
if (particle.originMcRec() == RecoDecay::OriginType::Prompt) {
originMcReco = 0;
} else if(particle.originMcRec() == RecoDecay::OriginType::NonPrompt) {
} else if (particle.originMcRec() == RecoDecay::OriginType::NonPrompt) {
originMcReco = 1;
} else {
originMcReco = 2;
Expand All @@ -774,7 +774,7 @@
originMcReco, -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999.,
-999.,
-999.,
hfHelper.yD0(particle), // getter transRadius
particle.mlProbD0()[0], // getter decayVtxX
particle.mlProbD0()[1], // getter decayVtxY
Expand All @@ -785,7 +785,7 @@
originMcReco, -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999.,
-999.,
hfHelper.yD0(particle), // getter transRadius
hfHelper.yD0(particle), // getter transRadius
particle.mlProbD0bar()[0], // getter decayVtxX
particle.mlProbD0bar()[1], // getter decayVtxY
particle.mlProbD0bar()[2], // getter decayVtxZ
Expand Down Expand Up @@ -882,8 +882,8 @@
phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake;
}

TLorentzVector part1Vec;

Check failure on line 885 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
TLorentzVector part2Vec;

Check failure on line 886 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

const auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header
const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header
Expand All @@ -891,7 +891,7 @@
part1Vec.SetPtEtaPhiM(kaon1MC.pt(), kaon1MC.eta(), kaon1MC.phi(), mMassOne);
part2Vec.SetPtEtaPhiM(kaon2MC.pt(), kaon2MC.eta(), kaon2MC.phi(), mMassTwo);

TLorentzVector sumVec(part1Vec);

Check failure on line 894 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
sumVec += part2Vec;

float phiEta = sumVec.Eta();
Expand Down Expand Up @@ -1567,8 +1567,8 @@
hfCand.eta(),
hfCand.phi(),
aod::femtouniverseparticle::ParticleType::kD0,
-999, // cut, CutContainerType
-999, // PID, CutContainerType
-999, // cut, CutContainerType
-999, // PID, CutContainerType
-999., // tempFitVar
indexChildID,
invMassD0, // D0 mass (mLambda)
Expand Down Expand Up @@ -1706,8 +1706,8 @@
hfCand.eta(),
hfCand.phi(),
aod::femtouniverseparticle::ParticleType::kD0,
-999, // cut, CutContainerType
-999, // PID, CutContainerType
-999, // cut, CutContainerType
-999, // PID, CutContainerType
-999., // tempFitVar
indexChildID,
invMassD0, // D0 mass (mLambda)
Expand All @@ -1725,7 +1725,7 @@
}
}
if constexpr (isMC) {
auto particleMother = mcParticles.rawIteratorAt(indexMcRec); // gen. level pT
auto particleMother = mcParticles.rawIteratorAt(indexMcRec); // gen. level pT
auto yGen = RecoDecay::y(particleMother.pVector(), o2::constants::physics::MassD0); // gen. level y
outputPartsMC(0, particleMother.pdgCode(), particleMother.pt(), yGen, particleMother.phi());
outputPartsMCLabels(outputPartsMC.lastIndex());
Expand Down Expand Up @@ -1774,8 +1774,8 @@
continue;
}

TLorentzVector part1Vec;

Check failure on line 1777 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
TLorentzVector part2Vec;

Check failure on line 1778 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

const auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header
const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header
Expand All @@ -1783,7 +1783,7 @@
part1Vec.SetPtEtaPhiM(p1.pt(), p1.eta(), p1.phi(), mMassOne);
part2Vec.SetPtEtaPhiM(p2.pt(), p2.eta(), p2.phi(), mMassTwo);

TLorentzVector sumVec(part1Vec);

Check failure on line 1786 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
sumVec += part2Vec;

float phiEta = sumVec.Eta();
Expand Down
2 changes: 1 addition & 1 deletion PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ struct FemtoUniverseEfficiencyBase {
break;
case 321: // Kaon+
case -321: // Kaon-
if(isKaonLF) {
if (isKaonLF) {
return isKaonNSigmaLF(mom, nsigmaTPCK, nsigmaTOFK);
} else {
return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK);
Expand Down
32 changes: 15 additions & 17 deletions PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseSoftPionRemoval.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h"
#include "PWGCF/FemtoUniverse/Core/femtoUtils.h"
#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"

#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/Core/DecayChannels.h"
#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/Core/SelectorCuts.h"
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
#include "PWGHF/DataModel/CandidateSelectionTables.h"

#include "Common/Core/RecoDecay.h"
#include "Common/DataModel/PIDResponse.h"
#include "Framework/AnalysisTask.h"

#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/runDataProcessing.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/StepTHn.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/PID.h"

#include <vector>
#include <string>
#include <vector>

using namespace o2;
using namespace o2::analysis;
Expand Down Expand Up @@ -253,7 +253,7 @@ struct FemtoUniversePairTaskTrackD0 {
float weight = 1.0;

HistogramRegistry registry{"registry",
{{"hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}},
{{"hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}},
{"hPtD0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}},
{"hPtD0D0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}},
{"hPhiD0D0bar", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., o2::constants::math::TwoPI}}}},
Expand Down Expand Up @@ -465,7 +465,7 @@ struct FemtoUniversePairTaskTrackD0 {
mcRecoRegistry.add("hMcRecAntiPrPt", "MC Reco antiproton;#it{p}_{T} (GeV/c); counts", {HistType::kTH1F, {{500, 0, 5}}});
mcRecoRegistry.add("hMcRecAntiPrPtGenEtaGen", "MC Reco antiproton;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}});

// MC truth
// MC truth
mcTruthRegistry.add("hMcGenD0", "MC Truth all D0s;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {400, -1.0, 1.0}}});
mcTruthRegistry.add("hMcGenD0Prompt", "MC Truth prompt D0s;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {400, -1.0, 1.0}}});
mcTruthRegistry.add("hMcGenD0NonPrompt", "MC Truth non-prompt D0s;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {400, -1.0, 1.0}}});
Expand Down Expand Up @@ -509,7 +509,6 @@ struct FemtoUniversePairTaskTrackD0 {

vPIDTrack = ConfTrack.confPIDTrack.value;
kNsigma = ConfBothTracks.confTrkPIDnSigmaMax.value;

}

template <typename CollisionType>
Expand Down Expand Up @@ -675,7 +674,7 @@ struct FemtoUniversePairTaskTrackD0 {
registry.fill(HIST("DebugBdt/hBdtScore1VsStatus"), d0d0bar.decayVtxX(), 1);
registry.fill(HIST("DebugBdt/hBdtScore2VsStatus"), d0d0bar.decayVtxY(), 1);
registry.fill(HIST("DebugBdt/hBdtScore3VsStatus"), d0d0bar.decayVtxZ(), 1);

weight = 1.0f;
if (doEfficiencyCorr) {
weight = efficiencyCalculator.getWeight(ParticleNo::TWO, d0d0bar.pt());
Expand Down Expand Up @@ -1154,20 +1153,20 @@ struct FemtoUniversePairTaskTrackD0 {
mcRecoRegistry.fill(HIST("hMcRecKmPtGenEtaGen"), mcpart.pt(), mcpart.eta());
}
}
}
}
} else if ((part.partType() == aod::femtouniverseparticle::ParticleType::kD0) && (part.pt() > ConfDmesons.confMinPtD0D0barReco) && (part.pt() < ConfDmesons.confMaxPtD0D0barReco)) {
if (mcpart.pdgMCTruth() == ConfDmesons.confPDGCodeD0) {
mcRecoRegistry.fill(HIST("hMcRecD0"), part.pt(), part.eta());
mcRecoRegistry.fill(HIST("hMcRecD0Phi"), part.phi());
if(part.tpcNClsFound() == 0) { // prompt candidates
if (part.tpcNClsFound() == 0) { // prompt candidates
mcRecoRegistry.fill(HIST("hMcRecD0Prompt"), part.pt(), part.eta());
} else if (part.tpcNClsFound() == 1) { // non-prompt candidates
mcRecoRegistry.fill(HIST("hMcRecD0NonPrompt"), part.pt(), part.eta());
}
} else if (mcpart.pdgMCTruth() == ConfDmesons.confPDGCodeD0bar) {
mcRecoRegistry.fill(HIST("hMcRecD0bar"), part.pt(), part.eta());
mcRecoRegistry.fill(HIST("hMcRecD0barPhi"), part.phi());
if(part.tpcNClsFound() == 0) { // prompt candidates
if (part.tpcNClsFound() == 0) { // prompt candidates
mcRecoRegistry.fill(HIST("hMcRecD0barPrompt"), part.pt(), part.eta());
} else if (part.tpcNClsFound() == 1) { // non-prompt candidates
mcRecoRegistry.fill(HIST("hMcRecD0barNonPrompt"), part.pt(), part.eta());
Expand All @@ -1194,14 +1193,14 @@ struct FemtoUniversePairTaskTrackD0 {
}
// filling the inv. mass histograms
if (part.mLambda() > 0) {
if(part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) {
if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) {
mcRecoRegistry.fill(HIST("hMassVsPtD0Sig"), part.mLambda(), part.pt(), weight);
} else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) {
mcRecoRegistry.fill(HIST("hMassVsPtD0Refl"), part.mLambda(), part.pt(), weight);
} else {
mcRecoRegistry.fill(HIST("hMassVsPtD0Bkg"), part.mLambda(), part.pt(), weight);
}
if(part.tpcNClsFound() == 0) { // prompt candidates
if (part.tpcNClsFound() == 0) { // prompt candidates
mcRecoRegistry.fill(HIST("hMassVsPtD0Prompt"), part.mLambda(), part.pt(), weight);
} else if (part.tpcNClsFound() == 1) { // non-prompt candidates
mcRecoRegistry.fill(HIST("hMassVsPtD0NonPrompt"), part.mLambda(), part.pt(), weight);
Expand All @@ -1214,7 +1213,7 @@ struct FemtoUniversePairTaskTrackD0 {
} else {
mcRecoRegistry.fill(HIST("hMassVsPtD0barBkg"), part.mAntiLambda(), part.pt(), weight);
}
if(part.tpcNClsFound() == 0) { // prompt candidates
if (part.tpcNClsFound() == 0) { // prompt candidates
mcRecoRegistry.fill(HIST("hMassVsPtD0barPrompt"), part.mAntiLambda(), part.pt(), weight);
} else if (part.tpcNClsFound() == 1) { // non-prompt candidates
mcRecoRegistry.fill(HIST("hMassVsPtD0barNonPrompt"), part.mAntiLambda(), part.pt(), weight);
Expand Down Expand Up @@ -1259,7 +1258,6 @@ struct FemtoUniversePairTaskTrackD0 {
mcTruthRegistry.fill(HIST("hMcGenD0NonPrompt"), part.pt(), part.eta());
}
}

}
if (pdgCode == PDG_t::kProton) {
mcTruthRegistry.fill(HIST("hMcGenPrPtVsEta"), part.pt(), part.eta());
Expand Down
Loading