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
16 changes: 16 additions & 0 deletions PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ class FemtoUniversePairCleaner
return false;
}
return part1.globalIndex() != part2.globalIndex();
} else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) {
/// V0-V0 combination both part1 and part2 are v0
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0 || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0) {
LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide first and second arguments kV0 candidate.";
return false;
}
// Getting v0 children for part1
const auto& posChild1 = particles.iteratorAt(part1.index() - 2);
const auto& negChild1 = particles.iteratorAt(part1.index() - 1);
// Getting v0 children for part2
const auto& posChild2 = particles.iteratorAt(part2.index() - 2);
const auto& negChild2 = particles.iteratorAt(part2.index() - 1);
if (posChild1.globalIndex() == posChild2.globalIndex() || negChild1.globalIndex() == negChild2.globalIndex()) {
return false;
}
return part1.globalIndex() != part2.globalIndex();
} else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) {
/// Track-D0 combination part1 is hadron and part2 is D0
if (part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kD0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ struct femtoUniversePairTaskTrackV0Extended {
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
}
}
/// This function processes the same event and takes care of all the histogramming
/// This function processes the same event for track - V0
void processSameEvent(o2::aod::FDCollision& col, FemtoFullParticles& parts)
{
const auto& magFieldTesla = col.magField();
Expand Down Expand Up @@ -242,9 +242,53 @@ struct femtoUniversePairTaskTrackV0Extended {
}
}

PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processSameEvent, "Enable processing same event", true);
PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processSameEvent, "Enable processing same event for track - V0", false);

/// This function processes the mixed event
/// This function processes the same event for V0 - V0
void processSameEventV0(o2::aod::FDCollision& col, FemtoFullParticles& parts)
{
const auto& magFieldTesla = col.magField();

auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
const int multCol = col.multNtr();

eventHisto.fillQA(col);

/// Histogramming same event
for (auto& part : groupPartsTwo) {
const auto& posChild = parts.iteratorAt(part.index() - 2);
const auto& negChild = parts.iteratorAt(part.index() - 1);
// printf("-- V0 d- %d d+ %d\n",negChild.globalIndex(),posChild.globalIndex());
if ((ConfV0Type > 0 && !IsParticleTPC(posChild, 0)) || (ConfV0Type < 0 && !IsParticleTPC(negChild, 0)))
continue;

trackHistoPartTwo.fillQA<false, false>(part);
posChildHistos.fillQA<false, false>(posChild);
negChildHistos.fillQA<false, false>(negChild);
}

/// Now build the combinations
for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) {
if (ConfIsCPR.value) {
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla)) {
continue;
}
}
// track cleaning
if (!pairCleaner.isCleanPair(p1, p2, parts)) {
continue;
}
const auto& posChild = parts.iteratorAt(p2.index() - 2);
const auto& negChild = parts.iteratorAt(p2.index() - 1);
if ((ConfV0Type > 0 && !IsParticleTPC(posChild, 0)) || (ConfV0Type < 0 && !IsParticleTPC(negChild, 0)))
continue;
sameEventCont.setPair<false>(p1, p2, multCol, ConfUse3D);
}
}

PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processSameEventV0, "Enable processing same event for V0 - V0", false);

/// This function processes the mixed event for track - V0
void processMixedEvent(o2::aod::FDCollisions& cols, FemtoFullParticles& parts)
{
ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{ConfVtxBins, ConfMultBins}, true};
Expand Down Expand Up @@ -285,7 +329,47 @@ struct femtoUniversePairTaskTrackV0Extended {
}
}

PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEvent, "Enable processing mixed events", true);
PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEvent, "Enable processing mixed events for track - V0", false);

/// This function processes the mixed event for V0 - V0
void processMixedEventV0(o2::aod::FDCollisions& cols, FemtoFullParticles& parts)
{
ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{ConfVtxBins, ConfMultBins}, true};

for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) {

const int multCol = collision1.multNtr();

auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);

const auto& magFieldTesla1 = collision1.magField();
const auto& magFieldTesla2 = collision2.magField();

if (magFieldTesla1 != magFieldTesla2) {
continue;
}

for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) {
if (ConfIsCPR.value) {
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1)) {
continue;
}
}
// track cleaning
if (!pairCleaner.isCleanPair(p1, p2, parts)) {
continue;
}
const auto& posChild = parts.iteratorAt(p2.index() - 2);
const auto& negChild = parts.iteratorAt(p2.index() - 1);
if ((ConfV0Type > 0 && !IsParticleTPC(posChild, 0)) || (ConfV0Type < 0 && !IsParticleTPC(negChild, 0)))
continue;
mixedEventCont.setPair<false>(p1, p2, multCol, ConfUse3D);
}
}
}

PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEventV0, "Enable processing mixed events for V0 - V0", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down