Skip to content
Merged
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
29 changes: 28 additions & 1 deletion PWGHF/D2H/Tasks/taskOmegac0ToOmegaPiQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ struct HfTaskOmegac0ToOmegaPiQa {
registry.get<THnSparse>(HIST("hReco"))->Sumw2();
}

template <typename CandType>
bool hasMlScore(const CandType& candidate)
{
if (!candidate.mlProbOmegaC0ToOmegaPi().empty()) {
return true;
}
return false;
}

template <bool ApplyMl, typename CandType>
void runDataAnalysis(const CandType& candidates)
{
Expand All @@ -169,6 +178,9 @@ struct HfTaskOmegac0ToOmegaPiQa {
}

if constexpr (ApplyMl) {
if (!hasMlScore(candidate)) {
continue;
}
registry.fill(HIST("hReco"), HfHelper::invMassOmegaczeroToOmegaPi(candidate), candidate.pt(), yOmegac, candidate.mlProbOmegaC0ToOmegaPi()[0]);
} else {
registry.fill(HIST("hReco"), HfHelper::invMassOmegaczeroToOmegaPi(candidate), candidate.pt(), yOmegac);
Expand All @@ -184,6 +196,12 @@ struct HfTaskOmegac0ToOmegaPiQa {
return;
}

if constexpr (ApplyMl) {
if (!hasMlScore(candidate)) {
return;
}
}

auto numPvContributors = collision.numContrib();
if constexpr (UseCentrality) {
float const cent = o2::hf_centrality::getCentralityColl(collision);
Expand Down Expand Up @@ -212,6 +230,9 @@ struct HfTaskOmegac0ToOmegaPiQa {
}

if constexpr (ApplyMl) {
if (!hasMlScore(candidate)) {
continue;
}
registry.fill(HIST("hReco"), HfHelper::invMassOmegaczeroToOmegaPi(candidate), candidate.pt(), yOmegac, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), candidate.mlProbOmegaC0ToOmegaPi()[0]);
} else {
registry.fill(HIST("hReco"), HfHelper::invMassOmegaczeroToOmegaPi(candidate), candidate.pt(), yOmegac, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec());
Expand Down Expand Up @@ -249,9 +270,15 @@ struct HfTaskOmegac0ToOmegaPiQa {

auto collision = candidate.template collision_as<CollisionsWithMcLabels>();
uint16_t const numPvContributors = collision.numContrib();
float const mcCent = o2::hf_centrality::getCentralityColl(collision.template mcCollision_as<McCollisionWithCents>());
float mcCent = -1.;
if (collision.has_mcCollision()) {
mcCent = o2::hf_centrality::getCentralityColl(collision.template mcCollision_as<McCollisionWithCents>());
}

if constexpr (ApplyMl) {
if (!hasMlScore(candidate)) {
continue;
}
registry.fill(HIST("hReco"), HfHelper::invMassOmegaczeroToOmegaPi(candidate), candidate.pt(), yOmegac, mcCent, numPvContributors, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), candidate.mlProbOmegaC0ToOmegaPi()[0]);
} else {
registry.fill(HIST("hReco"), HfHelper::invMassOmegaczeroToOmegaPi(candidate), candidate.pt(), yOmegac, mcCent, numPvContributors, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec());
Expand Down
12 changes: 8 additions & 4 deletions PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
std::string prefix = "lfBuilding";
// Options for internal cascade building - DCAFitter settings
// ...Initial vaules taken from PWGLF/Utils/strangenessBuilderHelper
Configurable<bool> propagateToPCA{"propagateToPCA", true, "Create tracks version propagated to PCA"};
Configurable<float> maxR{"maxR", 200., "Reject PCA's above this radius"};
Configurable<float> maxDZIni{"maxDZIni", 1e9, "Reject (if>0) PCA candidate if tracks DZ exceeds this threshold"};
Configurable<float> maxDXYIni{"maxDXYIni", 4.0f, "Reject (if>0) PCA candidate if tracks DXY exceeds this threshold"};
Expand Down Expand Up @@ -148,7 +147,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
// Cascade pre selection
Configurable<float> cascadeMassWindow{"cascadeMassWindow", 0.01, "Invariant mass tolerance for cascades"};
// Options for DCAFitter
Configurable<bool> propagateToPCA{"propagateToPCA", true, "Create tracks version propagated to PCA"};
Configurable<float> maxR{"maxR", 200., "Reject PCA's above this radius"};
Configurable<float> maxDZIni{"maxDZIni", 4., "Reject (if>0) PCA candidate if tracks DZ exceeds this threshold"};
Configurable<float> maxDXYIni{"maxDXYIni", 4., "Reject (if>0) PCA candidate if tracks DXY exceeds this threshold"};
Expand Down Expand Up @@ -270,7 +268,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
straHelper.cascadeselections.maxDaughterEta = lfConfigs.maxDaughterEta;

// Fitter setting
straHelper.fitter.setPropagateToPCA(lfConfigs.propagateToPCA);
straHelper.fitter.setPropagateToPCA(true);
straHelper.fitter.setMaxR(lfConfigs.maxR);
straHelper.fitter.setMaxDZIni(lfConfigs.maxDZIni);
straHelper.fitter.setMaxDXYIni(lfConfigs.maxDXYIni);
Expand All @@ -284,7 +282,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
// Extra initialization for DCAFitter
if (nProcessesDCA == 1) {
registry.get<TH1>(HIST("hVertexerType"))->Fill(aod::hf_cand::VertexerType::DCAFitter);
df.setPropagateToPCA(configs.propagateToPCA);
df.setPropagateToPCA(true);
df.setMaxR(configs.maxR);
df.setMaxDZIni(configs.maxDZIni);
df.setMaxDXYIni(configs.maxDXYIni);
Expand Down Expand Up @@ -589,6 +587,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
}

//----------Create charm baryon as KF Particle object starting from V0----------
// TODO: investigate if we can use the KFParticle object of cascade from straHelper instead of creating a new one here
// Create KFParticle object of V0 Daughter & Bachelor
const KFPTrack kfTrack0 = createKFPTrackFromTrack(posTrack);
const KFPTrack kfTrack1 = createKFPTrackFromTrack(negTrack);
Expand Down Expand Up @@ -1092,6 +1091,11 @@ struct HfCandidateCreatorXic0Omegac0QaMc {

void init(InitContext& initContext)
{
const std::array<bool, 3> mcProcesses{doprocessMcNoCent, doprocessMcCentFT0C, doprocessMcCentFT0M};
if (std::accumulate(mcProcesses.begin(), mcProcesses.end(), 0) > 1) {
LOGP(fatal, "At most one MC process function can be enabled at a time.");
}

const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name == "hf-candidate-creator-xic0-omegac0-qa") {
Expand Down
49 changes: 22 additions & 27 deletions PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPiQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct HfCandidateSelectorToOmegaPiQa {

// PID options
Configurable<bool> usePidTpcOnly{"usePidTpcOnly", true, "Perform PID using only TPC"};
Configurable<bool> usePidTpcTofCombined{"usePidTpcTofCombined", false, "Perform PID using TPC or TOF"};
Configurable<bool> usePidTpcOrTof{"usePidTpcOrTof", false, "Perform PID using TPC or TOF"};

// PID - TPC selections
Configurable<double> ptPiPidTpcMin{"ptPiPidTpcMin", -1, "Lower bound of track pT for TPC PID for pion selection"};
Expand Down Expand Up @@ -204,10 +204,10 @@ struct HfCandidateSelectorToOmegaPiQa {
Configurable<float> v0Chi2OverNdfMax{"v0Chi2OverNdfMax", 100., "Maximum chi2Geo/NDF of V0"};
Configurable<float> cascChi2OverNdfMax{"cascChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of casc"};
Configurable<float> omegacChi2OverNdfMax{"omegacChi2OverNdfMax", 100., "Maximum chi2Geo/NDF of Omegac"};
Configurable<float> chi2TopoV0ToCascMax{"chi2TopoV0ToCascMax", 100., "Maximum chi2Topo/NDF of V0ToCas"};
Configurable<float> chi2TopoOmegacToPvMax{"chi2TopoOmegacToPvMax", 100., "Maximum chi2Topo/NDF of OmegacToPv"};
Configurable<float> chi2TopoCascToOmegacMax{"chi2TopoCascToOmegacMax", 100., "Maximum chi2Topo/NDF of CascToOmegac"};
Configurable<float> chi2TopoCascToPvMax{"chi2TopoCascToPvMax", 100., "Maximum chi2Topo/NDF of CascToPv"};
Configurable<float> chi2TopoV0ToCascMax{"chi2TopoV0ToCascMax", 100., "Maximum chi2Topo of V0ToCasc"};
Configurable<float> chi2TopoOmegacToPvMax{"chi2TopoOmegacToPvMax", 100., "Maximum chi2Topo of OmegacToPv"};
Configurable<float> chi2TopoCascToOmegacMax{"chi2TopoCascToOmegacMax", 100., "Maximum chi2Topo of CascToOmegac"};
Configurable<float> chi2TopoCascToPvMax{"chi2TopoCascToPvMax", 100., "Maximum chi2Topo of CascToPv"};
Configurable<float> decayLenXYOmegacMax{"decayLenXYOmegacMax", 1.5, "Maximum decay lengthXY of Omegac"};
Configurable<float> decayLenXYCascMin{"decayLenXYCascMin", 1., "Minimum decay lengthXY of Cascade"};
Configurable<float> decayLenXYLambdaMin{"decayLenXYLambdaMin", 0., "Minimum decay lengthXY of V0"};
Expand All @@ -223,8 +223,8 @@ struct HfCandidateSelectorToOmegaPiQa {
LOGP(fatal, "Exactly one process function for selector can be enabled at a time.");
}

if (usePidTpcOnly == usePidTpcTofCombined) {
LOGF(fatal, "Check the PID configurables, usePidTpcOnly and usePidTpcTofCombined can't have the same value");
if (usePidTpcOnly == usePidTpcOrTof) {
LOGF(fatal, "Check the PID configurables, usePidTpcOnly and usePidTpcOrTof can't have the same value");
}

selectorPion.setRangePtTpc(ptPiPidTpcMin, ptPiPidTpcMax);
Expand Down Expand Up @@ -376,7 +376,7 @@ struct HfCandidateSelectorToOmegaPiQa {
}
}

// LF cuts - Cuts on LF tracks reco
// TODO: check if all these cuts are needed and remove those that are already applied in the candidate creator
// Selection on LF related informations
// returns true if all cuts are passed
template <int svReco, typename T>
Expand Down Expand Up @@ -507,8 +507,7 @@ struct HfCandidateSelectorToOmegaPiQa {
}
registry.fill(HIST("hSelStatusLf"), 22.0);

// TODO: fix cascRejectInvmass variable needed not available in the current table

// TODO: cascRejectInvmass variable not available in the current table, check if needed
// Competing Xi rejection
// if (kfConfigurableGroup.applyCompetingCascRejection) {
// const auto invMassXiHypothesis = candidate.cascRejectInvmass();
Expand Down Expand Up @@ -544,7 +543,7 @@ struct HfCandidateSelectorToOmegaPiQa {
return true;
}

// HF cuts - Cuts on Charm baryon reco
// TODO: check if all these cuts are needed and remove those that are already applied in the candidate creator
// Apply cuts with charm baryon & charm bachelor related informations
// returns true if all cuts are passed
template <int svReco, typename T>
Expand Down Expand Up @@ -597,11 +596,11 @@ struct HfCandidateSelectorToOmegaPiQa {
registry.fill(HIST("hSelStatusHf"), 5.0);

// Chi2
if (candidate.chi2GeoOverNdfCascade() < 0 || candidate.chi2GeoOverNdfCascade() > kfConfigurableGroup.omegacChi2OverNdfMax) {
if (candidate.chi2GeoOverNdf() < 0 || candidate.chi2GeoOverNdf() > kfConfigurableGroup.omegacChi2OverNdfMax) {
return false;
}
registry.fill(HIST("hSelStatusHf"), 6.0);
if (candidate.chi2TopoCascadeToPv() < 0 || candidate.chi2TopoCascadeToPv() > kfConfigurableGroup.chi2TopoOmegacToPvMax) {
if (candidate.chi2TopoToPv() < 0 || candidate.chi2TopoToPv() > kfConfigurableGroup.chi2TopoOmegacToPvMax) {
return false;
}
registry.fill(HIST("hSelStatusHf"), 7.0);
Expand Down Expand Up @@ -689,20 +688,19 @@ struct HfCandidateSelectorToOmegaPiQa {
// apply PID selection on the decay products
bool isSelectedPID(const TrackSelectorPID::Status pidPrFromLam, const TrackSelectorPID::Status pidPiFromLam, const TrackSelectorPID::Status pidKaFromCasc, const TrackSelectorPID::Status pidPiFromCharmBaryon)
{
// TODO: check PID logic, usually we require particles to not be TrackSelectorPID::Rejected
registry.fill(HIST("hSelStatusPID"), 0.0);

if (pidPrFromLam != TrackSelectorPID::Accepted || pidPiFromLam != TrackSelectorPID::Accepted) {
if (pidPrFromLam == TrackSelectorPID::Rejected || pidPiFromLam == TrackSelectorPID::Rejected) {
return false;
}
registry.fill(HIST("hSelStatusPID"), 1.0);

if (pidKaFromCasc != TrackSelectorPID::Accepted) {
if (pidKaFromCasc == TrackSelectorPID::Rejected) {
return false;
}
registry.fill(HIST("hSelStatusPID"), 2.0);

if (pidPiFromCharmBaryon != TrackSelectorPID::Accepted) {
if (pidPiFromCharmBaryon == TrackSelectorPID::Rejected) {
return false;
}
registry.fill(HIST("hSelStatusPID"), 3.0);
Expand All @@ -723,9 +721,7 @@ struct HfCandidateSelectorToOmegaPiQa {

if (!TESTBIT(candidate.hfflag(), aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi)) {
hfSelOmegaC0ToOmegaPiCandidate(statusOmegaC0ToOmegaPi);
if (applyMl) {
hfMlOmegaC0ToOmegaPiCandidate(outputMlOmegac);
}
hfMlOmegaC0ToOmegaPiCandidate(outputMlOmegac);
continue;
}
SETBIT(statusOmegaC0ToOmegaPi, aod::SelectionStep::RecoSkims);
Expand Down Expand Up @@ -753,9 +749,7 @@ struct HfCandidateSelectorToOmegaPiQa {

if (!selectedLf || !selectedHf || !selectedTrackQuality) {
hfSelOmegaC0ToOmegaPiCandidate(statusOmegaC0ToOmegaPi);
if (applyMl) {
hfMlOmegaC0ToOmegaPiCandidate(outputMlOmegac);
}
hfMlOmegaC0ToOmegaPiCandidate(outputMlOmegac);
continue;
}
SETBIT(statusOmegaC0ToOmegaPi, aod::SelectionStep::RecoTopol);
Expand All @@ -766,12 +760,13 @@ struct HfCandidateSelectorToOmegaPiQa {
TrackSelectorPID::Status pidKaFromCasc{};
TrackSelectorPID::Status pidPiFromCharmBaryon{};

// TODO: add TPC and TOF option for PID selection
if (usePidTpcOnly) {
pidPrFromLam = selectorProton.statusTpc(trackPrFromLam);
pidPiFromLam = selectorPion.statusTpc(trackPiFromLam);
pidKaFromCasc = selectorKaon.statusTpc(trackKaFromCasc);
pidPiFromCharmBaryon = selectorPion.statusTpc(trackPiFromCharm);
} else if (usePidTpcTofCombined) {
} else if (usePidTpcOrTof) {
pidPrFromLam = selectorProton.statusTpcOrTof(trackPrFromLam);
pidPiFromLam = selectorPion.statusTpcOrTof(trackPiFromLam);
pidKaFromCasc = selectorKaon.statusTpcOrTof(trackKaFromCasc);
Expand All @@ -780,9 +775,7 @@ struct HfCandidateSelectorToOmegaPiQa {

if (!isSelectedPID(pidPrFromLam, pidPiFromLam, pidKaFromCasc, pidPiFromCharmBaryon)) {
hfSelOmegaC0ToOmegaPiCandidate(statusOmegaC0ToOmegaPi);
if (applyMl) {
hfMlOmegaC0ToOmegaPiCandidate(outputMlOmegac);
}
hfMlOmegaC0ToOmegaPiCandidate(outputMlOmegac);
continue;
}
SETBIT(statusOmegaC0ToOmegaPi, aod::SelectionStep::RecoPID);
Expand All @@ -808,6 +801,8 @@ struct HfCandidateSelectorToOmegaPiQa {
continue;
}
SETBIT(statusOmegaC0ToOmegaPi, aod::SelectionStep::RecoMl);
} else {
hfMlOmegaC0ToOmegaPiCandidate(outputMlOmegac);
}

registry.fill(HIST("hInvMassCharmBaryon"), HfHelper::invMassOmegaczeroToOmegaPi(candidate));
Expand Down
20 changes: 11 additions & 9 deletions PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ struct HfCandidateSelectorToXiPiQa {
Configurable<double> v0MassWindow{"v0MassWindow", 0.01, "v0 mass window"};
Configurable<double> cascMassWindow{"cascMassWindow", 0.01, "cascade mass window"};
Configurable<double> invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.0, "Lower limit of invariant mass spectrum charm baryon"};
Configurable<double> invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Lower limit of invariant mass spectrum charm baryon"};
Configurable<double> invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit of invariant mass spectrum charm baryon"};
// PID options
Configurable<bool> usePidTpcOnly{"usePidTpcOnly", false, "Perform PID using only TPC"};
Configurable<bool> usePidTpcTofCombined{"usePidTpcTofCombined", true, "Perform PID using TPC & TOF"};
Configurable<bool> usePidTpcOrTof{"usePidTpcOrTof", true, "Perform PID using TPC or TOF"};
// PID - TPC selections
Configurable<double> ptPiPidTpcMin{"ptPiPidTpcMin", -1, "Lower bound of track pT for TPC PID for pion selection"};
Configurable<double> ptPiPidTpcMax{"ptPiPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for pion selection"};
Expand Down Expand Up @@ -292,7 +292,7 @@ struct HfCandidateSelectorToXiPiQa {
}
}

// LF cuts - Cuts on LF tracks reco
// TODO: check if all these cuts are needed and remove those that are already applied in the candidate creator
// Selection on LF related informations
// returns true if all cuts are passed
template <int svReco, typename T>
Expand Down Expand Up @@ -441,7 +441,7 @@ struct HfCandidateSelectorToXiPiQa {
return true;
}

// HF cuts - Cuts on Charm baryon reco
// TODO: check if all these cuts are needed and remove those that are already applied in the candidate creator
// Apply cuts with charm baryon & charm bachelor related informations
// returns true if all cuts are passed
template <int svReco, typename T>
Expand Down Expand Up @@ -492,8 +492,7 @@ struct HfCandidateSelectorToXiPiQa {
return false;
}
registry.fill(HIST("hSelStatusHf"), 7.0);
// TODO: check if this is needed
// The QA KF table has no dedicated charm-bachelor-to-PV topological chi2 column.
// TODO: check if this cut is needed,the QA KF table has no dedicated charm-bachelor-to-PV topological chi2 column
// if (candidate.chi2TopoPiFromXicToPv() < 0 || candidate.chi2TopoPiFromXicToPv() > cuts->get(inputPtBin, "chi2TopoPiFromXicToPv")) {
// return false;
// }
Expand All @@ -509,6 +508,7 @@ struct HfCandidateSelectorToXiPiQa {
}
registry.fill(HIST("hSelStatusHf"), 10.0);

// TODO: this is not correct for the OmegaC0->XiPi decay, need to differentiate between the two decays
// ctau
if (std::abs(HfHelper::ctXiczero(candidate)) > cuts->get(inputPtBin, "cTauXic")) {
return false;
Expand Down Expand Up @@ -639,27 +639,29 @@ struct HfCandidateSelectorToXiPiQa {
// Track level PID selection
registry.fill(HIST("hSelStatusPID"), 0.0);

if (usePidTpcOnly == usePidTpcTofCombined) {
LOGF(fatal, "Check the PID configurables, usePidTpcOnly and usePidTpcTofCombined can't have the same value");
if (usePidTpcOnly == usePidTpcOrTof) {
LOGF(fatal, "Check the PID configurables, usePidTpcOnly and usePidTpcOrTof can't have the same value");
}

TrackSelectorPID::Status statusPidPrFromLam{};
TrackSelectorPID::Status statusPidPiFromLam{};
TrackSelectorPID::Status statusPidPiFromCasc{};
TrackSelectorPID::Status statusPidPiFromCharmBaryon{};

// TODO: add TPC and TOF option for PID selection
if (usePidTpcOnly) {
statusPidPrFromLam = selectorProton.statusTpc(trackPrFromLam);
statusPidPiFromLam = selectorPion.statusTpc(trackPiFromLam);
statusPidPiFromCasc = selectorPion.statusTpc(trackPiFromCasc);
statusPidPiFromCharmBaryon = selectorPion.statusTpc(trackPiFromCharm);
} else if (usePidTpcTofCombined) {
} else if (usePidTpcOrTof) {
statusPidPrFromLam = selectorProton.statusTpcOrTof(trackPrFromLam);
statusPidPiFromLam = selectorPion.statusTpcOrTof(trackPiFromLam);
statusPidPiFromCasc = selectorPion.statusTpcOrTof(trackPiFromCasc);
statusPidPiFromCharmBaryon = selectorPion.statusTpcOrTof(trackPiFromCharm);
}

// TODO: check PID logic, usually we require particles to not be TrackSelectorPID::Rejected
const bool statusPidLambda = (statusPidPrFromLam == TrackSelectorPID::Accepted) && (statusPidPiFromLam == TrackSelectorPID::Accepted);
if (statusPidLambda) {
registry.fill(HIST("hSelStatusPID"), 1.0);
Expand Down
Loading
Loading