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
7 changes: 6 additions & 1 deletion PWGLF/DataModel/LFHStrangeCorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ namespace o2::aod
namespace triggerTracks
{
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag
DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Trigger"); //!
} // namespace triggerTracks
DECLARE_SOA_TABLE(TriggerTracks, "AOD", "TRIGGERTRACKS", o2::soa::Index<>, triggerTracks::CollisionId, triggerTracks::TrackId);
DECLARE_SOA_TABLE(TriggerTracks, "AOD", "TRIGGERTRACKS", o2::soa::Index<>, triggerTracks::CollisionId, triggerTracks::MCPhysicalPrimary, triggerTracks::TrackId);
/// _________________________________________
/// Table for storing assoc track indices
namespace assocPions
Expand All @@ -57,6 +58,7 @@ DECLARE_SOA_COLUMN(CompatibleAntiLambda, compatibleAntiLambda, bool); // compati
DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC
DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC
DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC
DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag
DECLARE_SOA_COLUMN(MassRegionK0Short, massRegionK0Short, int); //
DECLARE_SOA_COLUMN(MassRegionLambda, massRegionLambda, int); //
DECLARE_SOA_COLUMN(MassRegionAntiLambda, massRegionAntiLambda, int); //
Expand Down Expand Up @@ -109,6 +111,7 @@ DECLARE_SOA_TABLE(AssocV0s, "AOD", "ASSOCV0S", o2::soa::Index<>,
assocV0s::MCTrueK0Short,
assocV0s::MCTrueLambda,
assocV0s::MCTrueAntiLambda,
assocV0s::MCPhysicalPrimary,
assocV0s::MassRegionK0Short,
assocV0s::MassRegionLambda,
assocV0s::MassRegionAntiLambda,
Expand All @@ -130,6 +133,7 @@ DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true Xi
DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc
DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc
DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc
DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC
DECLARE_SOA_COLUMN(MassRegionXi, massRegionXi, int); //
DECLARE_SOA_COLUMN(MassRegionOmega, massRegionOmega, int); //
DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar)
Expand Down Expand Up @@ -186,6 +190,7 @@ DECLARE_SOA_TABLE(AssocCascades, "AOD", "ASSOCCASCADES", o2::soa::Index<>, assoc
assocCascades::MCTrueXiPlus,
assocCascades::MCTrueOmegaMinus,
assocCascades::MCTrueOmegaPlus,
assocCascades::MCPhysicalPrimary,
assocCascades::MassRegionXi,
assocCascades::MassRegionOmega,
assocCascades::Compatible<assocCascades::CompatibleXiMinus, assocCascades::CompatibleXiPlus, assocCascades::CompatibleOmegaMinus, assocCascades::CompatibleOmegaPlus>,
Expand Down
12 changes: 8 additions & 4 deletions PWGLF/DataModel/LFStrangenessTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ DECLARE_SOA_COLUMN(IsTrueLambda, isTrueLambda, bool); //! PDG
DECLARE_SOA_COLUMN(IsTrueAntiLambda, isTrueAntiLambda, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueHypertriton, isTrueHypertriton, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueAntiHypertriton, isTrueAntiHypertriton, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! physical primary

// dE/dx compatibility bools
DECLARE_SOA_COLUMN(IsdEdxGamma, isdEdxGamma, bool); //! compatible with dE/dx hypotheses
Expand All @@ -783,6 +784,7 @@ DECLARE_SOA_TABLE(V0Tags, "AOD", "V0TAGS",
v0tag::IsTrueAntiLambda,
v0tag::IsTrueHypertriton,
v0tag::IsTrueAntiHypertriton,
v0tag::IsPhysicalPrimary,
v0tag::IsdEdxGamma,
v0tag::IsdEdxK0Short,
v0tag::IsdEdxLambda,
Expand Down Expand Up @@ -1312,10 +1314,11 @@ namespace casctag
DECLARE_SOA_COLUMN(IsInteresting, isInteresting, bool); //! will this be built or not?

// MC association bools
DECLARE_SOA_COLUMN(IsTrueXiMinus, isTrueXiMinus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueXiPlus, isTrueXiPlus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueOmegaMinus, isTrueOmegaMinus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueOmegaPlus, isTrueOmegaPlus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueXiMinus, isTrueXiMinus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueXiPlus, isTrueXiPlus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueOmegaMinus, isTrueOmegaMinus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsTrueOmegaPlus, isTrueOmegaPlus, bool); //! PDG checked correctly in MC
DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! physical primary

// dE/dx compatibility bools
DECLARE_SOA_COLUMN(IsdEdxXiMinus, isdEdxXiMinus, bool); //! compatible with dE/dx hypotheses
Expand All @@ -1329,6 +1332,7 @@ DECLARE_SOA_TABLE(CascTags, "AOD", "CASCTAGS",
casctag::IsTrueXiPlus,
casctag::IsTrueOmegaMinus,
casctag::IsTrueOmegaPlus,
casctag::IsPhysicalPrimary,
casctag::IsdEdxXiMinus,
casctag::IsdEdxXiPlus,
casctag::IsdEdxOmegaMinus,
Expand Down
6 changes: 6 additions & 0 deletions PWGLF/TableProducer/Strangeness/cascadebuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,7 @@ struct cascadePreselector {
bitTrueXiMinus,
bitTrueXiPlus,
bitTrueOmegaMinus,
bitPhysicalPrimary,
bitTrueOmegaPlus,
bitdEdxXiMinus,
bitdEdxXiPlus,
Expand Down Expand Up @@ -2098,6 +2099,7 @@ struct cascadePreselector {
void checkPDG(TCascadeObject const& lCascadeCandidate, uint16_t& maskElement)
{
int lPDG = -1;
bool physicalPrimary = false;

// Acquire all three daughter tracks, please
auto lBachTrack = lCascadeCandidate.template bachelor_as<TTrackTo>();
Expand All @@ -2123,6 +2125,7 @@ struct cascadePreselector {
for (auto& lBachMother : lMCBachTrack.template mothers_as<aod::McParticles>()) {
if (lV0Mother == lBachMother) {
lPDG = lV0Mother.pdgCode();
physicalPrimary = lV0Mother.isPhysicalPrimary();

// additionally check PDG of the mother particle if requested
if (dIfMCselectV0MotherPDG != 0) {
Expand Down Expand Up @@ -2152,6 +2155,8 @@ struct cascadePreselector {
bitset(maskElement, bitTrueOmegaMinus);
if (lPDG == -3334)
bitset(maskElement, bitTrueOmegaPlus);
if (physicalPrimary)
bitset(maskElement, bitPhysicalPrimary);
}
//*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
/// function to check early dE/dx selection
Expand Down Expand Up @@ -2232,6 +2237,7 @@ struct cascadePreselector {
casctags(validCascade,
bitcheck(selectionMask[ii], bitTrueXiMinus), bitcheck(selectionMask[ii], bitTrueXiPlus),
bitcheck(selectionMask[ii], bitTrueOmegaMinus), bitcheck(selectionMask[ii], bitTrueOmegaPlus),
bitcheck(selectionMask[ii], bitPhysicalPrimary),
bitcheck(selectionMask[ii], bitdEdxXiMinus), bitcheck(selectionMask[ii], bitdEdxXiPlus),
bitcheck(selectionMask[ii], bitdEdxOmegaMinus), bitcheck(selectionMask[ii], bitdEdxOmegaPlus));
}
Expand Down
77 changes: 60 additions & 17 deletions PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ struct hstrangecorrelationfilter {
using V0LinkedTagged = soa::Join<aod::V0sLinked, aod::V0Tags>;
using CascadesLinkedTagged = soa::Join<aod::CascadesLinked, aod::CascTags>;
using DauTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::TracksDCA>;
using DauTracksMC = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::TracksDCA, aod::McTrackLabels>;
// using IDTracks= soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidBayesPi, aod::pidBayesKa, aod::pidBayesPr, aod::TOFSignal>; // prepared for Bayesian PID
using IDTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::TOFSignal, aod::TracksDCA>;
using V0DatasWithoutTrackX = soa::Join<aod::V0Indices, aod::V0Cores>;
Expand Down Expand Up @@ -166,6 +167,33 @@ struct hstrangecorrelationfilter {
histos.add("h3dMassOmegaPlus", "h3dMassOmegaPlus", kTH3F, {axisPtQA, axisOmegaMass, axisMult});
}

// reco-level trigger quality checks (N.B.: DCA is filtered, not selected)
template <class TTrack>
bool isValidTrigger(TTrack track)
{
if (track.eta() > triggerEtaMax || track.eta() < triggerEtaMin) {
return false;
}
// if (track.sign()= 1 ) {continue;}
if (track.pt() > triggerPtCutMax || track.pt() < triggerPtCutMin) {
return false;
}
if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) {
return false; // crossed rows
}
if (!track.hasITS() && triggerRequireITS) {
return false; // skip, doesn't have ITS signal (skips lots of TPC-only!)
}
if (track.tpcNClsShared() > triggerMaxTPCSharedClusters) {
return false; // skip, has shared clusters
}
if (!(bitcheck(track.itsClusterMap(), 0)) && triggerRequireL0) {
return false; // skip, doesn't have cluster in ITS L0
}
return true;
}

// for real data processing
void processTriggers(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, soa::Filtered<DauTracks> const& tracks)
{
// Perform basic event selection
Expand All @@ -180,30 +208,44 @@ struct hstrangecorrelationfilter {
/// _________________________________________________
/// Step 1: Populate table with trigger tracks
for (auto const& track : tracks) {
if (track.eta() > triggerEtaMax || track.eta() < triggerEtaMin) {
if (!isValidTrigger(track))
continue;
}
// if (track.sign()= 1 ) {continue;}
if (track.pt() > triggerPtCutMax || track.pt() < triggerPtCutMin) {
triggerTrack(
track.collisionId(),
false, // if you decide to check real data for primaries, you'll have a hard time
track.globalIndex());
}
}

// for MC processing
void processTriggersMC(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, soa::Filtered<DauTracksMC> const& tracks, aod::McParticles const&)
{
// Perform basic event selection
if (!collision.sel8()) {
return;
}
// No need to correlate stuff that's in far collisions
if (TMath::Abs(collision.posZ()) > 10.0) {
return;
}

/// _________________________________________________
/// Step 1: Populate table with trigger tracks
for (auto const& track : tracks) {
if (!isValidTrigger(track))
continue;
}
if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) {
continue; // crossed rows
}
if (!track.hasITS() && triggerRequireITS) {
continue; // skip, doesn't have ITS signal (skips lots of TPC-only!)
}
if (track.tpcNClsShared() > triggerMaxTPCSharedClusters) {
continue; // skip, has shared clusters
}
if (!(bitcheck(track.itsClusterMap(), 0)) && triggerRequireL0) {
continue; // skip, doesn't have cluster in ITS L0
bool physicalPrimary = false;
if (track.has_mcParticle()) {
auto mcParticle = track.mcParticle();
physicalPrimary = mcParticle.isPhysicalPrimary();
}
triggerTrack(
track.collisionId(),
physicalPrimary,
track.globalIndex());
}
}

void processAssocPions(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, soa::Filtered<IDTracks> const& tracks)
{
// Perform basic event selection
Expand Down Expand Up @@ -380,7 +422,7 @@ struct hstrangecorrelationfilter {
) {
assocV0(v0.collisionId(), v0.globalIndex(),
compatibleK0Short, compatibleLambda, compatibleAntiLambda,
origV0entry.isTrueK0Short(), origV0entry.isTrueLambda(), origV0entry.isTrueAntiLambda(),
origV0entry.isTrueK0Short(), origV0entry.isTrueLambda(), origV0entry.isTrueAntiLambda(), origV0entry.isPhysicalPrimary(),
massRegK0Short, massRegLambda, massRegAntiLambda);
}
}
Expand Down Expand Up @@ -482,6 +524,7 @@ struct hstrangecorrelationfilter {
compatibleXiMinus, compatibleXiPlus, compatibleOmegaMinus, compatibleOmegaPlus,
origCascadeEntry.isTrueXiMinus(), origCascadeEntry.isTrueXiPlus(),
origCascadeEntry.isTrueOmegaMinus(), origCascadeEntry.isTrueOmegaPlus(),
origCascadeEntry.isPhysicalPrimary(),
massRegXi, massRegOmega);
}
}
Expand Down
16 changes: 11 additions & 5 deletions PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ struct lambdakzeroPreselector {
Configurable<int> minITSCluITSOnly{"minITSCluITSOnly", 0, "minimum number of ITS clusters to ask for if daughter track does not have TPC"};

// for bit-packed maps
std::vector<uint16_t> selectionMask;
std::vector<uint32_t> selectionMask;
enum v0bit { bitInteresting = 0,
bitTrackQuality,
bitTrueGamma,
Expand All @@ -1386,6 +1386,7 @@ struct lambdakzeroPreselector {
bitTrueAntiLambda,
bitTrueHypertriton,
bitTrueAntiHypertriton,
bitPhysicalPrimary,
bitdEdxGamma,
bitdEdxK0Short,
bitdEdxLambda,
Expand Down Expand Up @@ -1419,7 +1420,7 @@ struct lambdakzeroPreselector {
//*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
/// function to check track quality
template <class TTrackTo, typename TV0Object>
void checkTrackQuality(TV0Object const& lV0Candidate, uint16_t& maskElement, bool passdEdx = false)
void checkTrackQuality(TV0Object const& lV0Candidate, uint32_t& maskElement, bool passdEdx = false)
{
auto lNegTrack = lV0Candidate.template negTrack_as<TTrackTo>();
auto lPosTrack = lV0Candidate.template posTrack_as<TTrackTo>();
Expand Down Expand Up @@ -1462,9 +1463,10 @@ struct lambdakzeroPreselector {
//*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
/// function to check PDG association
template <class TTrackTo, typename TV0Object>
void checkPDG(TV0Object const& lV0Candidate, uint16_t& maskElement)
void checkPDG(TV0Object const& lV0Candidate, uint32_t& maskElement)
{
int lPDG = -1;
bool physicalPrimary = false;
auto lNegTrack = lV0Candidate.template negTrack_as<TTrackTo>();
auto lPosTrack = lV0Candidate.template posTrack_as<TTrackTo>();

Expand All @@ -1478,6 +1480,7 @@ struct lambdakzeroPreselector {
for (auto& lPosMother : lMCPosTrack.template mothers_as<aod::McParticles>()) {
if (lNegMother.globalIndex() == lPosMother.globalIndex() && (!dIfMCselectPhysicalPrimary || lNegMother.isPhysicalPrimary())) {
lPDG = lNegMother.pdgCode();
physicalPrimary = lNegMother.isPhysicalPrimary();

// additionally check PDG of the mother particle if requested
if (dIfMCselectV0MotherPDG != 0) {
Expand Down Expand Up @@ -1507,10 +1510,12 @@ struct lambdakzeroPreselector {
bitset(maskElement, bitTrueHypertriton);
if (lPDG == -1010010030)
bitset(maskElement, bitTrueAntiHypertriton);
if (physicalPrimary)
bitset(maskElement, bitPhysicalPrimary);
}
//*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
template <class TTrackTo, typename TV0Object>
void checkdEdx(TV0Object const& lV0Candidate, uint16_t& maskElement)
void checkdEdx(TV0Object const& lV0Candidate, uint32_t& maskElement)
{
auto lNegTrack = lV0Candidate.template negTrack_as<TTrackTo>();
auto lPosTrack = lV0Candidate.template posTrack_as<TTrackTo>();
Expand Down Expand Up @@ -1593,7 +1598,8 @@ struct lambdakzeroPreselector {
}
v0tags(validV0,
bitcheck(selectionMask[ii], bitTrueGamma), bitcheck(selectionMask[ii], bitTrueK0Short), bitcheck(selectionMask[ii], bitTrueLambda),
bitcheck(selectionMask[ii], bitTrueAntiLambda), bitcheck(selectionMask[ii], bitTrueHypertriton), bitcheck(selectionMask[ii], bitTrueAntiHypertriton),
bitcheck(selectionMask[ii], bitTrueAntiLambda),
bitcheck(selectionMask[ii], bitTrueHypertriton), bitcheck(selectionMask[ii], bitTrueAntiHypertriton), bitcheck(selectionMask[ii], bitPhysicalPrimary),
bitcheck(selectionMask[ii], bitdEdxGamma), bitcheck(selectionMask[ii], bitdEdxK0Short), bitcheck(selectionMask[ii], bitdEdxLambda),
bitcheck(selectionMask[ii], bitdEdxAntiLambda), bitcheck(selectionMask[ii], bitdEdxHypertriton), bitcheck(selectionMask[ii], bitdEdxAntiHypertriton),
bitcheck(selectionMask[ii], bitUsedInCascade), bitcheck(selectionMask[ii], bitUsedInTrackedCascade));
Expand Down
Loading