Skip to content

Commit

Permalink
PWGHF: Little fix of the J/ψ → e+ e- code. (AliceO2Group#5265)
Browse files Browse the repository at this point in the history
- Fix usage of `std::move`.
- Use only positive match flag since, J/ψ is its own antiparticle.
- Fix comments.
  • Loading branch information
vkucera authored and jgrosseo committed Aug 18, 2021
1 parent 2329482 commit a055879
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
20 changes: 11 additions & 9 deletions Tasks/PWGHF/HFCandidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,15 @@ struct HFCandidateCreator2ProngMC {

// D0(bar) → π± K∓
//Printf("Checking D0(bar) → π± K∓");
if (RecoDecay::getMatchedMCRec(particlesMC, std::move(arrayDaughters), 421, array{+kPiPlus, -kKPlus}, true, &sign) > -1) {
if (RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 421, array{+kPiPlus, -kKPlus}, true, &sign) > -1) {
result = sign * D0ToPiK;
}
// Jpsi → e+e-

// J/ψ → e+ e-
if (result == N2ProngDecays) {
//Printf("Checking Jpsi → e+e-");
if (RecoDecay::getMatchedMCRec(particlesMC, std::move(arrayDaughters), 443, array{+kElectron, -kElectron}, true, &sign) > -1) {
result = sign * JpsiToEE;
//Printf("Checking J/ψ → e+ e-");
if (RecoDecay::getMatchedMCRec(particlesMC, std::move(arrayDaughters), 443, array{+kElectron, -kElectron}, true) > -1) {
result = JpsiToEE;
}
}

Expand All @@ -181,11 +182,12 @@ struct HFCandidateCreator2ProngMC {
if (RecoDecay::isMatchedMCGen(particlesMC, particle, 421, array{+kPiPlus, -kKPlus}, true, &sign)) {
result = sign * D0ToPiK;
}
// Jpsi → e+e-

// J/ψ → e+ e-
if (result == N2ProngDecays) {
//Printf("Checking Jpsi → e+e-");
if (RecoDecay::isMatchedMCGen(particlesMC, particle, 443, array{+kElectron, -kElectron}, true, &sign)) {
result = sign * JpsiToEE;
//Printf("Checking J/ψ → e+ e-");
if (RecoDecay::isMatchedMCGen(particlesMC, particle, 443, array{+kElectron, -kElectron}, true)) {
result = JpsiToEE;
}
}

Expand Down
6 changes: 1 addition & 5 deletions Tasks/PWGHF/HFJpsiToEECandidateSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@ struct HFJpsiToEECandidateSelector {
return true;
}

/// Check if track is compatible with given TPC Nsigma cut for a given flavour hypothesis
/// Check if track is compatible with given TPC Nsigma cut for the electron hypothesis
/// \param track is the track
/// \param nPDG is the flavour hypothesis PDG number
/// \param nSigmaCut is the nsigma threshold to test against
/// \note nPDG=11 electron
/// \return true if track satisfies TPC PID hypothesis for given Nsigma cut
template <typename T>
bool selectionPIDTPC(const T& track, int nSigmaCut)
Expand All @@ -148,8 +146,6 @@ struct HFJpsiToEECandidateSelector {

/// PID selection on daughter track
/// \param track is the daughter track
/// \param nPDG is the PDG code of the flavour hypothesis
/// \note nPDG=11 electron
/// \return 1 if successful PID match, 0 if successful PID rejection, -1 if no PID info
template <typename T>
int selectionPID(const T& track)
Expand Down

0 comments on commit a055879

Please sign in to comment.