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
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ namespace o2::aod
{
namespace hf_selcandidate_lc
{
DECLARE_SOA_COLUMN(IsSelLc, isSelLc, int);
DECLARE_SOA_COLUMN(IsSelLcpKpi, isSelLcpKpi, int);
DECLARE_SOA_COLUMN(IsSelLcpiKp, isSelLcpiKp, int);
} // namespace hf_selcandidate_lc
DECLARE_SOA_TABLE(HFSelLcCandidate, "AOD", "HFSELLCCAND", hf_selcandidate_lc::IsSelLc);
DECLARE_SOA_TABLE(HFSelLcCandidate, "AOD", "HFSELLCCAND", hf_selcandidate_lc::IsSelLcpKpi, hf_selcandidate_lc::IsSelLcpiKp);
} // namespace o2::aod

#endif // O2_ANALYSIS_HFCANDIDATESELECTIONTABLES_H_
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ DECLARE_SOA_TABLE(HfCandProng2Base, "AOD", "HFCANDP2BASE",
hf_cand::ImpactParameter0, hf_cand::ImpactParameter1,
hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1,
hf_track_index::Index0Id, hf_track_index::Index1Id,
hf_track_index::HFflag,
/* dynamic columns */
hf_cand_prong2::M<hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1>,
hf_cand_prong2::M2<hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1>,
Expand Down Expand Up @@ -340,10 +341,16 @@ auto ELc(const T& candidate)
}

template <typename T>
auto InvMassLc(const T& candidate)
auto InvMassLcpKpi(const T& candidate)
{
return candidate.m(array{RecoDecay::getMassPDG(kProton), RecoDecay::getMassPDG(kKPlus), RecoDecay::getMassPDG(kPiPlus)});
}

template <typename T>
auto InvMassLcpiKp(const T& candidate)
{
return candidate.m(array{RecoDecay::getMassPDG(kPiPlus), RecoDecay::getMassPDG(kKPlus), RecoDecay::getMassPDG(kProton)});
}
} // namespace hf_cand_prong3

// 3-prong decay candidate table
Expand All @@ -357,6 +364,7 @@ DECLARE_SOA_TABLE(HfCandProng3Base, "AOD", "HFCANDP3BASE",
hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ImpactParameter2,
hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2,
hf_track_index::Index0Id, hf_track_index::Index1Id, hf_track_index::Index2Id,
hf_track_index::HFflag,
/* dynamic columns */
hf_cand_prong3::M<hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, hf_cand::PxProng2, hf_cand::PyProng2, hf_cand::PzProng2>,
hf_cand_prong3::M2<hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, hf_cand::PxProng2, hf_cand::PyProng2, hf_cand::PzProng2>,
Expand Down
3 changes: 2 additions & 1 deletion Analysis/Tasks/PWGHF/HFCandidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ struct HFCandidateCreator2Prong {
pvec1[0], pvec1[1], pvec1[2],
impactParameter0.getY(), impactParameter1.getY(),
std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()),
rowTrackIndexProng2.index0Id(), rowTrackIndexProng2.index1Id());
rowTrackIndexProng2.index0Id(), rowTrackIndexProng2.index1Id(),
rowTrackIndexProng2.hfflag());

// fill histograms
if (b_dovalplots) {
Expand Down
3 changes: 2 additions & 1 deletion Analysis/Tasks/PWGHF/HFCandidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ struct HFCandidateCreator3Prong {
pvec2[0], pvec2[1], pvec2[2],
impactParameter0.getY(), impactParameter1.getY(), impactParameter2.getY(),
std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), std::sqrt(impactParameter2.getSigmaY2()),
rowTrackIndexProng3.index0Id(), rowTrackIndexProng3.index1Id(), rowTrackIndexProng3.index2Id());
rowTrackIndexProng3.index0Id(), rowTrackIndexProng3.index1Id(), rowTrackIndexProng3.index2Id(),
rowTrackIndexProng3.hfflag());

// fill histograms
if (b_dovalplots) {
Expand Down
2 changes: 1 addition & 1 deletion Analysis/Tasks/PWGHF/HFD0CandidateSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct HFD0CandidateSelector {
}
}

if (TMath::Abs(trackPion.pt()) < TMath::Abs(cuts[pTBin][4]) || TMath::Abs(trackKaon.pt()) < TMath::Abs(cuts[pTBin][3])) {
if (trackPion.pt() < cuts[pTBin][4] || trackKaon.pt() < cuts[pTBin][3]) {
return false; //cut on daughter pT
}
if (TMath::Abs(trackPion.dcaPrim0()) > cuts[pTBin][6] || TMath::Abs(trackKaon.dcaPrim0()) > cuts[pTBin][5]) {
Expand Down
110 changes: 62 additions & 48 deletions Analysis/Tasks/PWGHF/HFLcCandidateSelector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// \file HFD0CandidateSelector.cxx
/// \brief Lc->pKpi selection task.
///
/// \author Luigi Dello Stritto <luigi.dellostritto@cern.ch>, CERN
/// \author Luigi Dello Stritto <luigi.dello.stritto@cern.ch>, University and INFN SALERNO
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>, CERN

#include "Framework/runDataProcessing.h"
Expand All @@ -27,19 +27,18 @@ static const int npTBins = 10;
static const int nCutVars = 8;
//temporary until 2D array in configurable is solved - then move to json
//m ptp ptk ptpi DCA sigmavtx dlenght cosp
constexpr double cuts[npTBins][nCutVars] = {{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* pt<1 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 1<pt<2 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 2<pt<3 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 3<pt<4 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 4<pt<5 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 5<pt<6 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 6<pt<8 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 8<pt<12 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}, /* 12<pt<24 */
{0.5, 0.2, 0.2, 0.2, 0.05, 0.09, 0.005, 0.}}; /* 24<pt<36 */
constexpr double cuts[npTBins][nCutVars] = {{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* pt<1 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 1<pt<2 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 2<pt<3 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 3<pt<4 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 4<pt<5 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 5<pt<6 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 6<pt<8 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 8<pt<12 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}, /* 12<pt<24 */
{0.400, 0.4, 0.4, 0.4, 0.05, 0.09, 0.005, 0.}}; /* 24<pt<36 */

/// Struct for applying Lc selection cuts

struct HFLcCandidateSelector {

Produces<aod::HFSelLcCandidate> hfSelLcCandidate;
Expand Down Expand Up @@ -107,15 +106,16 @@ struct HFLcCandidateSelector {
if (candpT < d_pTCandMin || candpT >= d_pTCandMax) {
return false; //check that the candidate pT is within the analysis range
}

if (hfCandProng3.cpa() <= cuts[pTBin][7]) {
return false; //cosine of pointing angle
}
// if (hfCandProng3.dca() > cuts[pTBin][4]) return false; //candidate DCA
if (hfCandProng3.chi2PCA() > cuts[pTBin][5]) { //candidate DCA

/* if (hfCandProng3.chi2PCA() > cuts[pTBin][5]) { //candidate DCA
return false;
}
}*/

if (hfCandProng3.decayLength() * hfCandProng3.decayLength() < cuts[pTBin][6] * cuts[pTBin][6]) {
if (hfCandProng3.decayLength() <= cuts[pTBin][6]) {
return false;
}
return true;
Expand All @@ -126,7 +126,6 @@ struct HFLcCandidateSelector {
/// \param trackProton is the track with the proton hypothesis
/// \param trackPion is the track with the pion hypothesis
/// \param trackKaon is the track with the kaon hypothesis
/// \note trackPion = positive and trackKaon = negative for D0 selection and inverse for D0bar
/// \return true if candidate passes all cuts for the given Conjugate
template <typename T1, typename T2>
bool selectionTopolConjugate(const T1& hfCandProng3, const T2& trackProton, const T2& trackKaon, const T2& trackPion)
Expand All @@ -138,18 +137,19 @@ struct HFLcCandidateSelector {
return false;
}

//invariant mass cut
if (TMath::Abs(InvMassLc(hfCandProng3) - RecoDecay::getMassPDG(4122)) > cuts[pTBin][0]) {
return false;
}

if (TMath::Abs(trackProton.pt()) < TMath::Abs(cuts[pTBin][1]) || TMath::Abs(trackKaon.pt()) < TMath::Abs(cuts[pTBin][2]) || TMath::Abs(trackPion.pt()) < TMath::Abs(cuts[pTBin][3])) {
if (trackProton.pt() < cuts[pTBin][1] || trackKaon.pt() < cuts[pTBin][2] || trackPion.pt() < cuts[pTBin][3]) {
return false; //cut on daughter pT
}

/* if (TMath::Sqrt( trackProton.dcaPrim0()*trackProton.dcaPrim0() + trackKaon.dcaPrim0()*trackKaon.dcaPrim0() + trackPion.dcaPrim0()*trackPion.dcaPrim0() ) > cuts[pTBin][5]) {
return false; //cut on daughter dca - need to add secondary vertex constraint here
}*/
if (trackProton.globalIndex() == hfCandProng3.index0Id()) {
if (TMath::Abs(InvMassLcpKpi(hfCandProng3) - RecoDecay::getMassPDG(4122)) > cuts[pTBin][0]) {
return false;
}
} else {
if (TMath::Abs(InvMassLcpiKp(hfCandProng3) - RecoDecay::getMassPDG(4122)) > cuts[pTBin][0]) {
return false;
}
}

return true;
}
Expand Down Expand Up @@ -190,17 +190,17 @@ struct HFLcCandidateSelector {
template <typename T>
bool selectionPIDTPC(const T& track, int nPDG, int nSigmaCut)
{
double nSigma = 100.0; //arbitarily large value
double nSigma = 1.0; //arbitarily large value
nPDG = TMath::Abs(nPDG);
if (nPDG == 2212) {
/* if (nPDG == 2212) {
nSigma = track.tpcNSigmaPr();
} else if (nPDG == 321) {
nSigma = track.tpcNSigmaKa();
} else if (nPDG == 111) {
nSigma = track.tpcNSigmaPi();
} else {
return false;
}
}*/
return nSigma < nSigmaCut;
}

Expand All @@ -213,17 +213,17 @@ struct HFLcCandidateSelector {
template <typename T>
bool selectionPIDTOF(const T& track, int nPDG, int nSigmaCut)
{
double nSigma = 100.0; //arbitarily large value
double nSigma = 1.; //arbitarily large value
nPDG = TMath::Abs(nPDG);
if (nPDG == 2212) {
/* if (nPDG == 2212) {
nSigma = track.tofNSigmaPr();
} else if (nPDG == 321) {
nSigma = track.tofNSigmaKa();
} else if (nPDG == 321) {
nSigma = track.tofNSigmaPi();
} else {
return false;
}
}*/
return nSigma < nSigmaCut;
}

Expand Down Expand Up @@ -279,42 +279,53 @@ struct HFLcCandidateSelector {

void process(aod::HfCandProng3 const& hfCandProng3s, aod::BigTracksPID const& tracks)
{
int statusLc; // final selection flag : 0-rejected 1-accepted
bool topolLc;
int statusLcpKpi, statusLcpiKp; // final selection flag : 0-rejected 1-accepted
bool topolLcpKpi, topolLcpiKp;
int pidLc, proton, kaonMinus, pionPlus;

for (auto& hfCandProng3 : hfCandProng3s) { //looping over 3 prong candidates

auto trackPos1 = hfCandProng3.index0_as<aod::BigTracksPID>(); //positive daughter
auto trackNeg1 = hfCandProng3.index1_as<aod::BigTracksPID>(); //negative daughter
auto trackPos2 = hfCandProng3.index2_as<aod::BigTracksPID>(); //positive daughter
statusLcpKpi = 0;
statusLcpiKp = 0;
int LcFlag = hfCandProng3.hfflag();

statusLc = 0;
topolLc = true;
if (!(LcFlag & 1 << 1)) {
hfSelLcCandidate(statusLcpKpi, statusLcpiKp);
continue;
}

auto trackPos1 = hfCandProng3.index0_as<aod::BigTracksPID>(); //positive daughter (negative for the antiparticles)
auto trackNeg1 = hfCandProng3.index1_as<aod::BigTracksPID>(); //negative daughter (positive for the antiparticles)
auto trackPos2 = hfCandProng3.index2_as<aod::BigTracksPID>(); //positive daughter (negative for the antiparticles)

topolLcpKpi = true;
topolLcpiKp = true;
pidLc = -1;
proton = -1;
kaonMinus = -1;
pionPlus = -1;

// daughter track validity selection
if (!daughterSelection(trackPos1) || !daughterSelection(trackNeg1) || !daughterSelection(trackPos2)) {
hfSelLcCandidate(statusLc);
hfSelLcCandidate(statusLcpKpi, statusLcpiKp);
continue;
}

//implement filter bit 4 cut - should be done before this task at the track selection level

//conjugate independent topological selection
if (!selectionTopol(hfCandProng3)) {
hfSelLcCandidate(statusLc);
hfSelLcCandidate(statusLcpKpi, statusLcpiKp);
continue;
}

//conjugate dependent toplogical selection for Lc
topolLc = selectionTopolConjugate(hfCandProng3, trackPos1, trackNeg1, trackPos2);

if (!topolLc) {
hfSelLcCandidate(statusLc);
topolLcpKpi = selectionTopolConjugate(hfCandProng3, trackPos1, trackNeg1, trackPos2);
topolLcpiKp = selectionTopolConjugate(hfCandProng3, trackPos2, trackNeg1, trackPos1);

if (!topolLcpKpi && !topolLcpiKp) {
hfSelLcCandidate(statusLcpKpi, statusLcpiKp);
continue;
}

Expand All @@ -330,15 +341,18 @@ struct HFLcCandidateSelector {
}

if (pidLc == 0) {
hfSelLcCandidate(statusLc);
hfSelLcCandidate(statusLcpKpi, statusLcpiKp);
continue;
}

if ((pidLc == -1 || pidLc == 1) && topolLc) {
statusLc = 1; //identified as Lc
if ((pidLc == -1 || pidLc == 1) && topolLcpKpi) {
statusLcpKpi = 1; //identified as Lc
}
if ((pidLc == -1 || pidLc == 1) && topolLcpiKp) {
statusLcpiKp = 1; //identified as Lc
}

hfSelLcCandidate(statusLc);
hfSelLcCandidate(statusLcpKpi, statusLcpiKp);
}
}
};
Expand Down
Loading