Skip to content
Open
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
76 changes: 68 additions & 8 deletions PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <iterator>
Expand All @@ -86,7 +87,7 @@ using namespace o2::hf_occupancy;
using namespace o2::constants::physics;
using namespace o2::hf_evsel;

constexpr int nMcDecayChannels = hf_decay::hf_cand_casc_bach_qa::DecayChannelMain::NChannelsMain;
constexpr int NMcDecayChannels = hf_decay::hf_cand_casc_bach_qa::DecayChannelMain::NChannelsMain;

struct HfCandidateCreatorXic0Omegac0Qa {
Produces<HfCandCascBachBaseQa> rowCandCascBatch;
Expand Down Expand Up @@ -234,6 +235,27 @@ struct HfCandidateCreatorXic0Omegac0Qa {
LOGF(info, " Chosen reconstruction info: ToXiPi(%d)/ ToOmegaPi(%d)/ ToOmegaKa(%d)", configs.createToXiPi.value, configs.createOmegaCToOmegaPi.value, configs.createOmegaCToOmegaK.value);
LOGF(info, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

// Histtograms for QA - Applied pre selections in lfBuilding
registry.add("PreSelectQA/h2V0PosDauPtEta", "V0 pos daughter, pT vs Eta;pT(GeV);eta", {kTH2F, {{200, 0.0, 10.0}, {200, -5.0, 5.0}}});
registry.add("PreSelectQA/h2V0NegDauPtEta", "V0 neg daughter, pT vs Eta;pT(GeV);eta", {kTH2F, {{200, 0.0, 10.0}, {200, -5.0, 5.0}}});
registry.add("PreSelectQA/h2BachPtEta", "Casc bachelor, pT vs Eta;pT(GeV);eta", {kTH2F, {{200, 0.0, 10.0}, {200, -5.0, 5.0}}});

registry.add("PreSelectQA/h2V0PosDauPtDcaXY", "V0 pos daughter, pT vs DcaXY to PV;pT;DcaXY To PV", {kTH2F, {{200, 0.0, 10.0}, {2000, -10.0, 10.0}}});
registry.add("PreSelectQA/h2V0NegDauPtDcaXY", "V0 neg daughter, pT vs DcaXY to PV;pT;DcaXY To PV", {kTH2F, {{200, 0.0, 10.0}, {2000, -10.0, 10.0}}});
registry.add("PreSelectQA/h2BachPtDcaXY", "Casc bachelor, pT vs DcaXY to PV;pT;DcaXY To PV", {kTH2F, {{200, 0.0, 10.0}, {2000, -10.0, 10.0}}});

registry.add("PreSelectQA/h2V0PosDauPtTpcNClsCrossedRows", "V0 pos daughter, pT vs TPCNClsCrossedRows;pT;TpcNClsCrossedRows", {kTH2F, {{200, 0.0, 10.0}, {200, 0.0, 200}}});
registry.add("PreSelectQA/h2V0NegDauPtTpcNClsCrossedRows", "V0 neg daughter, pT vs TPCNClsCrossedRows;pT;TpcNClsCrossedRows", {kTH2F, {{200, 0.0, 10.0}, {200, 0.0, 200}}});
registry.add("PreSelectQA/h2BachPtTpcNClsCrossedRows", "Casc bachelor, pT vs TPCNClsCrossedRows;pT;TpcNClsCrossedRows", {kTH2F, {{200, 0.0, 10.0}, {200, 0.0, 200}}});

registry.add("PreSelectQA/h2V0PtRadius", "V0, pT vs radius;pT;V0Radius", {kTH2F, {{200, 0.0, 20.0}, {1000, 0.0, 100}}});
registry.add("PreSelectQA/h2V0PtDaughterDca", "V0, pT vs Dca between daughters;pT;Dca between Daughters", {kTH2F, {{200, 0.0, 20.0}, {200, -10.0, 10}}});
registry.add("PreSelectQA/h2V0PtCosPA", "V0, pT vs cosPA;pT;CosPA", {kTH2F, {{200, 0.0, 20.0}, {100, 0.9, 1.0}}});

registry.add("PreSelectQA/h2CascPtRadius", "Casc, pT vs radius;pT;CascRadius", {kTH2F, {{200, 0.0, 20.0}, {1000, 0.0, 100}}});
registry.add("PreSelectQA/h2CascPtDaughterDca", "Casc, pT vs Dca between daughters;pT;Dca between Daughters", {kTH2F, {{200, 0.0, 20.0}, {200, -10.0, 10}}});
registry.add("PreSelectQA/h2CascPtCosPA", "Casc, pT vs cosPA;pT;CosPA", {kTH2F, {{200, 0.0, 20.0}, {100, 0.9, 1.0}}});

// Add histogram to indicate which sv method was used
registry.add("hVertexerType", "Use KF or DCAFitterN;Vertexer type;entries", {kTH1F, {{2, 0.0, 2.0}}});
registry.get<TH1>(HIST("hVertexerType"))->GetXaxis()->SetBinLabel(1 + aod::hf_cand::VertexerType::DCAFitter, "DCAFitter");
Expand Down Expand Up @@ -418,6 +440,25 @@ struct HfCandidateCreatorXic0Omegac0Qa {
registry.fill(HIST("hCascPt"), RecoDecay::pt(straHelper.cascade.cascadeMomentum));
if (configs.fillHistograms) {
hCandCounter->Fill(CascReconstructed);
registry.fill(HIST("PreSelectQA/h2V0PosDauPtEta"), posTrack.pt(), posTrack.eta());
registry.fill(HIST("PreSelectQA/h2V0NegDauPtEta"), negTrack.pt(), negTrack.eta());
registry.fill(HIST("PreSelectQA/h2BachPtEta"), bachTrack.pt(), bachTrack.eta());

registry.fill(HIST("PreSelectQA/h2V0PosDauPtDcaXY"), posTrack.pt(), straHelper.cascade.positiveDCAxy);
registry.fill(HIST("PreSelectQA/h2V0NegDauPtDcaXY"), negTrack.pt(), straHelper.cascade.negativeDCAxy);
registry.fill(HIST("PreSelectQA/h2BachPtDcaXY"), bachTrack.pt(), straHelper.cascade.bachelorDCAxy);

registry.fill(HIST("PreSelectQA/h2V0PosDauPtTpcNClsCrossedRows"), posTrack.pt(), posTrack.tpcNClsCrossedRows());
registry.fill(HIST("PreSelectQA/h2V0NegDauPtTpcNClsCrossedRows"), negTrack.pt(), negTrack.tpcNClsCrossedRows());
registry.fill(HIST("PreSelectQA/h2BachPtTpcNClsCrossedRows"), bachTrack.pt(), bachTrack.tpcNClsCrossedRows());

registry.fill(HIST("PreSelectQA/h2V0PtRadius"), RecoDecay::pt(straHelper.cascade.v0Momentum), std::hypot(straHelper.cascade.v0Position[0], straHelper.cascade.v0Position[1]));
registry.fill(HIST("PreSelectQA/h2V0PtDaughterDca"), RecoDecay::pt(straHelper.cascade.v0Momentum), straHelper.cascade.v0DaughterDCA);
registry.fill(HIST("PreSelectQA/h2V0PtCosPA"), RecoDecay::pt(straHelper.cascade.v0Momentum), std::cos(straHelper.v0.pointingAngle));

registry.fill(HIST("PreSelectQA/h2CascPtRadius"), RecoDecay::pt(straHelper.cascade.cascadeMomentum), std::hypot(straHelper.cascade.cascadePosition[0], straHelper.cascade.cascadePosition[1]));
registry.fill(HIST("PreSelectQA/h2CascPtDaughterDca"), RecoDecay::pt(straHelper.cascade.cascadeMomentum), straHelper.cascade.cascadeDaughterDCA);
registry.fill(HIST("PreSelectQA/h2CascPtCosPA"), RecoDecay::pt(straHelper.cascade.cascadeMomentum), std::cos(straHelper.cascade.pointingAngle));
}

//------------------------------Create cascade track------------------------------
Expand Down Expand Up @@ -659,6 +700,25 @@ struct HfCandidateCreatorXic0Omegac0Qa {
registry.fill(HIST("hCascPt"), RecoDecay::pt(kfCasc.GetPx(), kfCasc.GetPy()));
if (configs.fillHistograms) {
hCandCounter->Fill(CascReconstructed);
registry.fill(HIST("PreSelectQA/h2V0PosDauPtEta"), posTrack.pt(), posTrack.eta());
registry.fill(HIST("PreSelectQA/h2V0NegDauPtEta"), negTrack.pt(), negTrack.eta());
registry.fill(HIST("PreSelectQA/h2BachPtEta"), bachTrack.pt(), bachTrack.eta());

registry.fill(HIST("PreSelectQA/h2V0PosDauPtDcaXY"), posTrack.pt(), straHelper.cascade.positiveDCAxy);
registry.fill(HIST("PreSelectQA/h2V0NegDauPtDcaXY"), negTrack.pt(), straHelper.cascade.negativeDCAxy);
registry.fill(HIST("PreSelectQA/h2BachPtDcaXY"), bachTrack.pt(), straHelper.cascade.bachelorDCAxy);

registry.fill(HIST("PreSelectQA/h2V0PosDauPtTpcNClsCrossedRows"), posTrack.pt(), posTrack.tpcNClsCrossedRows());
registry.fill(HIST("PreSelectQA/h2V0NegDauPtTpcNClsCrossedRows"), negTrack.pt(), negTrack.tpcNClsCrossedRows());
registry.fill(HIST("PreSelectQA/h2BachPtTpcNClsCrossedRows"), bachTrack.pt(), bachTrack.tpcNClsCrossedRows());

registry.fill(HIST("PreSelectQA/h2V0PtRadius"), RecoDecay::pt(straHelper.cascade.v0Momentum), std::hypot(straHelper.cascade.v0Position[0], straHelper.cascade.v0Position[1]));
registry.fill(HIST("PreSelectQA/h2V0PtDaughterDca"), RecoDecay::pt(straHelper.cascade.v0Momentum), straHelper.cascade.v0DaughterDCA);
registry.fill(HIST("PreSelectQA/h2V0PtCosPA"), RecoDecay::pt(straHelper.cascade.v0Momentum), std::cos(straHelper.v0.pointingAngle));

registry.fill(HIST("PreSelectQA/h2CascPtRadius"), RecoDecay::pt(straHelper.cascade.cascadeMomentum), std::hypot(straHelper.cascade.cascadePosition[0], straHelper.cascade.cascadePosition[1]));
registry.fill(HIST("PreSelectQA/h2CascPtDaughterDca"), RecoDecay::pt(straHelper.cascade.cascadeMomentum), straHelper.cascade.cascadeDaughterDCA);
registry.fill(HIST("PreSelectQA/h2CascPtCosPA"), RecoDecay::pt(straHelper.cascade.cascadeMomentum), std::cos(straHelper.cascade.pointingAngle));
}

//~~~~~~~Construct Charm Baryon with KF~~~~~~~
Expand Down Expand Up @@ -1061,12 +1121,12 @@ struct HfCandidateCreatorXic0Omegac0QaMc {
Configurable<bool> matchInteractionsWithMaterial{"matchInteractionsWithMaterial", true, "Match also candidates with tracks that interact with material"};
} configs;

std::array<int, nMcDecayChannels> pdgOfCharmBaryon{+kXiC0, +kXiC0, +kOmegaC0, +kOmegaC0, +kOmegaC0};
std::array<int, nMcDecayChannels> pdgOfCascade{+kXiMinus, +kOmegaMinus, +kOmegaMinus, +kOmegaMinus, +kXiMinus};
std::array<int, nMcDecayChannels> pdgOfCharmBachelor{+kPiPlus, +kKPlus, +kPiPlus, +kKPlus, +kPiPlus};
std::array<int, nMcDecayChannels> pdgOfBachelor{+kPiMinus, +kKMinus, +kKMinus, +kKMinus, +kPiMinus};
std::array<int, NMcDecayChannels> pdgOfCharmBaryon{+kXiC0, +kXiC0, +kOmegaC0, +kOmegaC0, +kOmegaC0};
std::array<int, NMcDecayChannels> pdgOfCascade{+kXiMinus, +kOmegaMinus, +kOmegaMinus, +kOmegaMinus, +kXiMinus};
std::array<int, NMcDecayChannels> pdgOfCharmBachelor{+kPiPlus, +kKPlus, +kPiPlus, +kKPlus, +kPiPlus};
std::array<int, NMcDecayChannels> pdgOfBachelor{+kPiMinus, +kKMinus, +kKMinus, +kKMinus, +kPiMinus};

std::array<int8_t, nMcDecayChannels> decayChannelFlags{hf_decay::hf_cand_casc_bach_qa::DecayChannelMain::Xic0ToXiPi,
std::array<int8_t, NMcDecayChannels> decayChannelFlags{hf_decay::hf_cand_casc_bach_qa::DecayChannelMain::Xic0ToXiPi,
hf_decay::hf_cand_casc_bach_qa::DecayChannelMain::Xic0ToOmegaK,
hf_decay::hf_cand_casc_bach_qa::DecayChannelMain::Omegac0ToOmegaPi,
hf_decay::hf_cand_casc_bach_qa::DecayChannelMain::Omegac0ToOmegaK,
Expand Down Expand Up @@ -1174,7 +1234,7 @@ struct HfCandidateCreatorXic0Omegac0QaMc {
}
}

for (int decayChannel = 0; decayChannel < nMcDecayChannels; ++decayChannel) {
for (int decayChannel = 0; decayChannel < NMcDecayChannels; ++decayChannel) {
int8_t nPiToMu = 0;
int8_t nKaToPi = 0;
int8_t nMaterial = 0;
Expand Down Expand Up @@ -1258,7 +1318,7 @@ struct HfCandidateCreatorXic0Omegac0QaMc {
continue;
}

for (int decayChannel = 0; decayChannel < nMcDecayChannels; ++decayChannel) {
for (int decayChannel = 0; decayChannel < NMcDecayChannels; ++decayChannel) {
// Charm Baryon -> Cascade + Charm bachelor
if (RecoDecay::isMatchedMCGen<false, true>(mcParticles, particle, pdgOfCharmBaryon[decayChannel], std::array{pdgOfCascade[decayChannel], pdgOfCharmBachelor[decayChannel]}, true, &sign)) {
for (auto const& daughterCharm : particle.template daughters_as<aod::McParticles>()) {
Expand Down
Loading
Loading