Skip to content

Commit fa98e59

Browse files
authored
Enhance V0 daughter selection and processing
Updated V0 daughter selection criteria and added new configurable parameters for V0 daughters. Adjusted processing functions to accommodate changes in V0 handling.
1 parent 047b5df commit fa98e59

1 file changed

Lines changed: 53 additions & 45 deletions

File tree

PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx

Lines changed: 53 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "PWGHF/HFC/DataModel/CorrelationTables.h"
2121
#include "PWGHF/HFC/Utils/utilsCorrelations.h"
2222
#include "PWGHF/Utils/utilsAnalysis.h"
23+
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
2324
#include "PWGLF/DataModel/LFStrangenessTables.h"
2425

2526
#include "Common/CCDB/EventSelectionParams.h"
@@ -377,14 +378,14 @@ struct HfCorrelatorXicHadrons {
377378
} cfgXicCand;
378379

379380
struct : ConfigurableGroup {
380-
Configurable<float> cfgDaughPrPtMax{"cfgDaughPrPtMax", 5., "max. pT Daughter Proton"};
381-
Configurable<float> cfgDaughPrPtMin{"cfgDaughPrPtMin", 0.3, "min. pT Daughter Proton"};
382-
Configurable<float> cfgDaughPiPtMax{"cfgDaughPiPtMax", 10., "max. pT Daughter Pion"};
383-
Configurable<float> cfgDaughPiPtMin{"cfgDaughPiPtMin", 0.3, "min. pT Daughter Pion"};
384-
Configurable<float> cfgDaughPIDCutsTPCPr{"cfgDaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"};
385-
Configurable<float> cfgDaughPIDCutsTPCPi{"cfgDaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"};
386-
Configurable<float> cfgDaughPIDCutsTOFPi{"cfgDaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"};
387-
Configurable<float> cfgDaughPIDCutsTOFPr{"cfgDaughPIDCutsTOFPr", 2.5, "max. TOFnSigma Pion"};
381+
Configurable<float> cfgV0DaughPrPtMax{"cfgV0DaughPrPtMax", 5., "max. pT Daughter Proton"};
382+
Configurable<float> cfgV0DaughPrPtMin{"cfgV0DaughPrPtMin", 0.3, "min. pT Daughter Proton"};
383+
Configurable<float> cfgV0DaughPiPtMax{"cfgV0DaughPiPtMax", 10., "max. pT Daughter Pion"};
384+
Configurable<float> cfgV0DaughPiPtMin{"cfgV0DaughPiPtMin", 0.3, "min. pT Daughter Pion"};
385+
Configurable<float> cfgV0DaughPIDCutsTPCPr{"cfgV0DaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"};
386+
Configurable<float> cfgV0DaughPIDCutsTPCPi{"cfgV0DaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"};
387+
Configurable<float> cfgV0DaughPIDCutsTOFPi{"cfgV0DaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"};
388+
Configurable<float> cfgV0DaughPIDCutsTOFPr{"cfgV0DaughPIDCutsTOFPr", -2.5, "min. TOFnSigma Proton (put only negative value)"};
388389
Configurable<float> cfgHypMassWindow{"cfgHypMassWindow", 0.1, "single lambda mass selection"};
389390
Configurable<bool> cfgIsCorrCollMatchV0{"cfgIsCorrCollMatchV0", true, "check if daughter and mother collision are same"};
390391
Configurable<bool> cfgCalDataDrivenEffPr{"cfgCalDataDrivenEffPr", false, "calculate data driven efficiency of proton using Lambda"};
@@ -399,6 +400,7 @@ struct HfCorrelatorXicHadrons {
399400
Configurable<int> cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"};
400401
Configurable<float> cfgPV{"cfgPV", 10., "maximum z-vertex"};
401402
Configurable<bool> calEffV0{"calEffV0", false, "calculate lambda0 efficiency"};
403+
Configurable<bool> checkTOFForPion{"checkTOFForPion", false, "if True, TOF selection on pion V0 wil only be applied if TOF present"};
402404
} cfgV0;
403405

404406
SliceCache cache;
@@ -647,65 +649,71 @@ struct HfCorrelatorXicHadrons {
647649
}
648650

649651
template <typename Tracktype, typename V0Type>
650-
bool isSelectedV0Daughter(Tracktype const& track, V0Type v0, int pid)
652+
bool isSelectedV0Daughter(Tracktype const& track, V0Type const& v0, int pid)
651653
{
652654
if (std::abs(track.eta()) > cfgXicCand.etaTrackMax) {
653655
return false;
654656
}
657+
655658
// ---------------------------------------------------------
656659
// 1. Proton PID Selection
657660
// ---------------------------------------------------------
658661
if (std::abs(pid) == kProton) {
662+
bool hasTOFProton = (pid > 0) ? v0.positiveHasTOF() : v0.negativeHasTOF();
659663
bool passTOF = false;
660664

661-
if (track.pt() > cfgV0.cfgDaughPrPtMax || track.pt() < cfgV0.cfgDaughPrPtMin) {
665+
if (track.pt() > cfgV0.cfgV0DaughPrPtMax || track.pt() < cfgV0.cfgV0DaughPrPtMin) {
662666
return false;
663667
}
664-
if (track.hasTOF()) {
668+
669+
if (hasTOFProton && (track.pt() > cfgXicCand.tofPIDThreshold)) {
665670
if constexpr (std::experimental::is_detected<HasStrangeTOFinV0, V0Type>::value) {
666671
// pid > 0: Proton from Lambda (LaPr)
667672
// pid < 0: Antiproton from Anti-Lambda (ALaPr)
668673
double strangeTOF = (pid > 0) ? v0.tofNSigmaLaPr() : v0.tofNSigmaALaPr();
669-
passTOF = std::abs(strangeTOF) > cfgV0.cfgDaughPIDCutsTOFPr;
674+
passTOF = strangeTOF > cfgV0.cfgV0DaughPIDCutsTOFPr;
675+
670676
} else {
671677
// if strange TOF is unavailable
672-
passTOF = std::abs(track.tofNSigmaPr()) > cfgV0.cfgDaughPIDCutsTOFPr;
678+
passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr;
673679
}
680+
674681
}
675682

676-
if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgDaughPIDCutsTPCPr) || passTOF) {
683+
if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) {
677684
return false;
678685
}
679686
}
680687

681688
// ---------------------------------------------------------
682689
// 2. Pion PID Selection
683690
// ---------------------------------------------------------
684-
if (std::abs(pid) == kPiPlus) {
691+
if (std::abs(pid) == kPiPlus && cfgV0.checkTOFForPion) {
692+
bool hasTOFPion = (pid < 0) ? v0.negativeHasTOF() : v0.positiveHasTOF();
685693
bool passTOF = false;
686694

687-
if (track.pt() > cfgV0.cfgDaughPiPtMax || track.pt() < cfgV0.cfgDaughPiPtMin) {
695+
if (track.pt() > cfgV0.cfgV0DaughPiPtMax || track.pt() < cfgV0.cfgV0DaughPiPtMin) {
688696
return false;
689697
}
690698

691-
if (track.hasTOF()) {
699+
if (hasTOFPion && (track.pt() > cfgXicCand.tofPIDThreshold)) {
692700
if constexpr (std::experimental::is_detected<HasStrangeTOFinV0, V0Type>::value) {
693701
// A pion can belong to either a Lambda/Anti-Lambda decay or a K0s decay.
694702
// We evaluate both applicable hypotheses based on charge sign and pick the best match.
695703
double tofLa = (pid > 0) ? v0.tofNSigmaALaPi() : v0.tofNSigmaLaPi();
696704

697-
passTOF = tofLa > cfgV0.cfgDaughPIDCutsTOFPi;
705+
passTOF = std::abs(tofLa) > cfgV0.cfgV0DaughPIDCutsTOFPi;
698706
} else {
699707
// Fallback to standard track TOF
700-
passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgDaughPIDCutsTOFPi;
708+
passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi;
701709
}
710+
702711
}
703712

704-
if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgDaughPIDCutsTPCPi) || passTOF) {
713+
if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) {
705714
return false;
706715
}
707716
}
708-
709717
return true;
710718
}
711719

@@ -730,7 +738,7 @@ struct HfCorrelatorXicHadrons {
730738
}
731739

732740
// Process Lambda (proton + pion)
733-
if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) {
741+
if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) {
734742
entryHadron(v0.mLambda(), trackV0Pos.eta(), trackV0Pos.pt() * trackV0Pos.sign(), 0, 0, v0.pt());
735743
entryTrkPID(trackV0Pos.tpcNSigmaPr(), trackV0Pos.tpcNSigmaKa(), trackV0Pos.tpcNSigmaPi(), trackV0Pos.tofNSigmaPr(), trackV0Pos.tofNSigmaKa(), trackV0Pos.tofNSigmaPi());
736744

@@ -754,7 +762,7 @@ struct HfCorrelatorXicHadrons {
754762
}
755763
}
756764

757-
if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) {
765+
if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) {
758766
entryHadron(v0.mAntiLambda(), trackV0Neg.eta(), trackV0Neg.pt() * trackV0Neg.sign(), 0, 0, v0.pt());
759767
entryTrkPID(trackV0Neg.tpcNSigmaPr(), trackV0Neg.tpcNSigmaKa(), trackV0Neg.tpcNSigmaPi(), trackV0Neg.tofNSigmaPr(), trackV0Neg.tofNSigmaKa(), trackV0Neg.tofNSigmaPi());
760768

@@ -787,7 +795,7 @@ struct HfCorrelatorXicHadrons {
787795
auto const& partV0Pos = trackV0Pos.mcParticle();
788796
auto const& partV0Neg = trackV0Neg.mcParticle();
789797

790-
if (passV0Sel && v0Mc.pdgCode() == kLambda0) {
798+
if (passV0Sel && v0Mc.pdgCode() == kLambda0 && v0.alpha() > 0) {
791799
if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) {
792800
registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
793801
registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
@@ -802,7 +810,7 @@ struct HfCorrelatorXicHadrons {
802810
}
803811
}
804812
}
805-
if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar) {
813+
if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar && v0.alpha() < 0) {
806814
if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) {
807815
registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt());
808816
registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt());
@@ -849,12 +857,12 @@ struct HfCorrelatorXicHadrons {
849857

850858
if (std::abs(currentDaughter.pdgCode()) == kProton) {
851859

852-
if (currentDaughter.pt() > cfgV0.cfgDaughPrPtMax || currentDaughter.pt() < cfgV0.cfgDaughPrPtMin) {
860+
if (currentDaughter.pt() > cfgV0.cfgV0DaughPrPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPrPtMin) {
853861
continue;
854862
}
855863

856864
} else if (std::abs(currentDaughter.pdgCode()) == kPiPlus) {
857-
if (currentDaughter.pt() > cfgV0.cfgDaughPiPtMax || currentDaughter.pt() < cfgV0.cfgDaughPiPtMin) {
865+
if (currentDaughter.pt() > cfgV0.cfgV0DaughPiPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPiPtMin) {
858866
continue;
859867
}
860868

@@ -1032,7 +1040,7 @@ struct HfCorrelatorXicHadrons {
10321040
}
10331041

10341042
// Process Lambda (proton-pion)
1035-
if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) {
1043+
if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) {
10361044
if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) {
10371045

10381046
if (selXicCand) {
@@ -1050,7 +1058,7 @@ struct HfCorrelatorXicHadrons {
10501058
}
10511059

10521060
// Process anti-Lambda (anti-proton-pion)
1053-
if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) {
1061+
if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) {
10541062
if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) {
10551063

10561064
if (selXicCand) {
@@ -1484,14 +1492,14 @@ struct HfCorrelatorXicHadrons {
14841492
auto const& trackV0Pos = assocParticle.template posTrack_as<TrackType>();
14851493
auto const& trackV0Neg = assocParticle.template negTrack_as<TrackType>();
14861494

1487-
if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow) {
1495+
if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() > 0) {
14881496
if (isSelectedV0Daughter(trackV0Pos, assocParticle, kProton) && isSelectedV0Daughter(trackV0Neg, assocParticle, kPiPlus)) {
14891497

14901498
fillCorrelationTable<IsMcRec, V0LambdaType::Lambda>(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles);
14911499
}
14921500
}
14931501

1494-
if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow) {
1502+
if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() < 0) {
14951503
if (isSelectedV0Daughter(trackV0Neg, assocParticle, -kProton) && isSelectedV0Daughter(trackV0Pos, assocParticle, -kPiPlus)) {
14961504
fillCorrelationTable<IsMcRec, V0LambdaType::AntiLambda>(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles);
14971505
}
@@ -1571,7 +1579,7 @@ struct HfCorrelatorXicHadrons {
15711579
listDaughters.clear();
15721580
const std::size_t nDaughtersExpected = IsXicPlus ? XicDecayDaughtersCount::XicPlusDaughtersCount : XicDecayDaughtersCount::Xic0DaughtersCount;
15731581

1574-
if (IsXicPlus) {
1582+
if (IsXicPlus) {
15751583
// Final state: p, pi-, pi-, pi+, pi+
15761584
std::array<int, XicDecayDaughtersCount::XicPlusDaughtersCount> const arrDaughXicPlusPDG = {kProton, kPiMinus, kPiMinus, kPiPlus, kPiPlus};
15771585

@@ -1696,7 +1704,7 @@ struct HfCorrelatorXicHadrons {
16961704
/// Data processing: XicPlus with V0 Lambda
16971705
void processDataXicPlusV0(SelCollisions::iterator const& collision,
16981706
TracksData const& tracks,
1699-
aod::V0Datas const& v0s,
1707+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas> const& v0s,
17001708
CandsXicPlusDataFiltered const& candidates,
17011709
aod::BCsWithTimestamps const&)
17021710
{
@@ -1707,7 +1715,7 @@ struct HfCorrelatorXicHadrons {
17071715
/// MC Reco processing: XicPlus with V0 Lambda
17081716
void processMcRecXicPlusV0(SelCollisions::iterator const& collision,
17091717
TracksWithMc const& tracks,
1710-
soa::Join<aod::V0Datas, aod::McV0Labels> const& v0s,
1718+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas, aod::McV0Labels> const& v0s,
17111719
CandsXicPlusMcRecFiltered const& candidates,
17121720
aod::McParticles const& mcParticles)
17131721
{
@@ -1718,7 +1726,7 @@ struct HfCorrelatorXicHadrons {
17181726
/// Data processing: Xic0 with V0 Lambda
17191727
void processDataXic0V0(SelCollisions::iterator const& collision,
17201728
TracksData const& tracks,
1721-
aod::V0Datas const& v0s,
1729+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas> const& v0s,
17221730
CandsXic0DataFiltered const& candidates,
17231731
aod::BCsWithTimestamps const&)
17241732
{
@@ -1729,7 +1737,7 @@ struct HfCorrelatorXicHadrons {
17291737
/// MC Reco processing: Xic0 with V0 Lambda
17301738
void processMcRecXic0V0(SelCollisions::iterator const& collision,
17311739
TracksWithMc const& tracks,
1732-
soa::Join<aod::V0Datas, aod::McV0Labels> const& v0s,
1740+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas, aod::McV0Labels> const& v0s,
17331741
CandsXic0McRecFiltered const& candidates,
17341742
aod::McParticles const& mcParticles)
17351743
{
@@ -1740,7 +1748,7 @@ struct HfCorrelatorXicHadrons {
17401748
/// MC Reco processing: Xic0 with V0 Lambda
17411749
void processV0McRec(SelCollisions::iterator const& collision,
17421750
TracksWithMc const& tracks,
1743-
soa::Join<aod::V0Datas, aod::McV0Labels> const& v0s,
1751+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas, aod::McV0Labels> const& v0s,
17441752
aod::McParticles const& mcParticles)
17451753
{
17461754
fillEffV0<true>(collision, v0s, tracks, mcParticles);
@@ -1797,7 +1805,7 @@ struct HfCorrelatorXicHadrons {
17971805
/// NOTE: V0 mixed events are more complex - need proper binning and collision matching
17981806
void processDataMixedEventXicPlusV0(SelCollisions const& collisions,
17991807
CandsXicPlusDataFiltered const& candidates,
1800-
aod::V0Datas const& v0s,
1808+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas> const& v0s,
18011809
TracksData const& tracks)
18021810
{
18031811
doMixEvent<false, 1, 1>(collisions, v0s, candidates, tracks);
@@ -1807,7 +1815,7 @@ struct HfCorrelatorXicHadrons {
18071815
/// MC Reco Mixed Event: XicPlus with V0 Lambda
18081816
void processMcRecMixedEventXicPlusV0(SelCollisions const& collisions,
18091817
CandsXicPlusMcRecFiltered const& candidates,
1810-
soa::Join<aod::V0Datas, aod::McV0Labels> const& v0s,
1818+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas, aod::McV0Labels> const& v0s,
18111819
TracksWithMc const& tracks,
18121820
aod::McParticles const& mcParticles)
18131821
{
@@ -1818,7 +1826,7 @@ struct HfCorrelatorXicHadrons {
18181826
/// Data Mixed Event: Xic0 with V0 Lambda
18191827
void processDataMixedEventXic0V0(SelCollisions const& collisions,
18201828
CandsXic0DataFiltered const& candidates,
1821-
aod::V0Datas const& v0s,
1829+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas> const& v0s,
18221830
TracksData const& tracks)
18231831
{
18241832
doMixEvent<false, 0, 1>(collisions, v0s, candidates, tracks);
@@ -1828,7 +1836,7 @@ struct HfCorrelatorXicHadrons {
18281836
/// MC Reco Mixed Event: Xic0 with V0 Lambda
18291837
void processMcRecMixedEventXic0V0(SelCollisions const& collisions,
18301838
CandsXic0McRecFiltered const& candidates,
1831-
soa::Join<aod::V0Datas, aod::McV0Labels> const& v0s,
1839+
soa::Join<aod::V0Datas, aod::V0TOFNSigmas, aod::McV0Labels> const& v0s,
18321840
TracksWithMc const& tracks,
18331841
aod::McParticles const& mcParticles)
18341842
{
@@ -1902,7 +1910,7 @@ struct HfCorrelatorXicHadrons {
19021910
candSign = ParticleType::AntiParticle;
19031911
}
19041912

1905-
int8_t const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge();
1913+
auto const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge();
19061914
float cent = 100.0;
19071915

19081916
int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true);
@@ -1924,8 +1932,8 @@ struct HfCorrelatorXicHadrons {
19241932
PROCESS_SWITCH(HfCorrelatorXicHadrons, processMcGenMixedEvent, "Process Mixed Event McGen", false);
19251933
};
19261934

1927-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
1935+
WorkflowSpec defineDataProcessing(ConfigContext const& context)
19281936
{
1929-
return WorkflowSpec{adaptAnalysisTask<HfCorrelatorXicHadronsSelection>(cfgc),
1930-
adaptAnalysisTask<HfCorrelatorXicHadrons>(cfgc)};
1937+
return WorkflowSpec{adaptAnalysisTask<HfCorrelatorXicHadronsSelection>(context),
1938+
adaptAnalysisTask<HfCorrelatorXicHadrons>(context)};
19311939
}

0 commit comments

Comments
 (0)