Skip to content

Commit 4ad9fb0

Browse files
EloviyoShirajum Monira
andauthored
PWGCF: FemtoUniverse -- Added V0-V0 combination and clean pair check (#5133)
* Added V0-V0 combination and clean pair check * clang format fix --------- Co-authored-by: Shirajum Monira <shirajum.monira@cernch>
1 parent 3b59cec commit 4ad9fb0

2 files changed

Lines changed: 104 additions & 4 deletions

File tree

PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@ class FemtoUniversePairCleaner
8484
return false;
8585
}
8686
return part1.globalIndex() != part2.globalIndex();
87+
} else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) {
88+
/// V0-V0 combination both part1 and part2 are v0
89+
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0 || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0) {
90+
LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide first and second arguments kV0 candidate.";
91+
return false;
92+
}
93+
// Getting v0 children for part1
94+
const auto& posChild1 = particles.iteratorAt(part1.index() - 2);
95+
const auto& negChild1 = particles.iteratorAt(part1.index() - 1);
96+
// Getting v0 children for part2
97+
const auto& posChild2 = particles.iteratorAt(part2.index() - 2);
98+
const auto& negChild2 = particles.iteratorAt(part2.index() - 1);
99+
if (posChild1.globalIndex() == posChild2.globalIndex() || negChild1.globalIndex() == negChild2.globalIndex()) {
100+
return false;
101+
}
102+
return part1.globalIndex() != part2.globalIndex();
87103
} else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) {
88104
/// Track-D0 combination part1 is hadron and part2 is D0
89105
if (part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kD0) {

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

Lines changed: 88 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ struct femtoUniversePairTaskTrackV0Extended {
178178
pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRdeltaPhiCut.value, ConfCPRdeltaEtaCut.value, ConfCPRPlotPerRadii.value);
179179
}
180180
}
181-
/// This function processes the same event and takes care of all the histogramming
181+
/// This function processes the same event for track - V0
182182
void processSameEvent(o2::aod::FDCollision& col, FemtoFullParticles& parts)
183183
{
184184
const auto& magFieldTesla = col.magField();
@@ -242,9 +242,53 @@ struct femtoUniversePairTaskTrackV0Extended {
242242
}
243243
}
244244

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

247-
/// This function processes the mixed event
247+
/// This function processes the same event for V0 - V0
248+
void processSameEventV0(o2::aod::FDCollision& col, FemtoFullParticles& parts)
249+
{
250+
const auto& magFieldTesla = col.magField();
251+
252+
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
253+
const int multCol = col.multNtr();
254+
255+
eventHisto.fillQA(col);
256+
257+
/// Histogramming same event
258+
for (auto& part : groupPartsTwo) {
259+
const auto& posChild = parts.iteratorAt(part.index() - 2);
260+
const auto& negChild = parts.iteratorAt(part.index() - 1);
261+
// printf("-- V0 d- %d d+ %d\n",negChild.globalIndex(),posChild.globalIndex());
262+
if ((ConfV0Type > 0 && !IsParticleTPC(posChild, 0)) || (ConfV0Type < 0 && !IsParticleTPC(negChild, 0)))
263+
continue;
264+
265+
trackHistoPartTwo.fillQA<false, false>(part);
266+
posChildHistos.fillQA<false, false>(posChild);
267+
negChildHistos.fillQA<false, false>(negChild);
268+
}
269+
270+
/// Now build the combinations
271+
for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) {
272+
if (ConfIsCPR.value) {
273+
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla)) {
274+
continue;
275+
}
276+
}
277+
// track cleaning
278+
if (!pairCleaner.isCleanPair(p1, p2, parts)) {
279+
continue;
280+
}
281+
const auto& posChild = parts.iteratorAt(p2.index() - 2);
282+
const auto& negChild = parts.iteratorAt(p2.index() - 1);
283+
if ((ConfV0Type > 0 && !IsParticleTPC(posChild, 0)) || (ConfV0Type < 0 && !IsParticleTPC(negChild, 0)))
284+
continue;
285+
sameEventCont.setPair<false>(p1, p2, multCol, ConfUse3D);
286+
}
287+
}
288+
289+
PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processSameEventV0, "Enable processing same event for V0 - V0", false);
290+
291+
/// This function processes the mixed event for track - V0
248292
void processMixedEvent(o2::aod::FDCollisions& cols, FemtoFullParticles& parts)
249293
{
250294
ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{ConfVtxBins, ConfMultBins}, true};
@@ -285,7 +329,47 @@ struct femtoUniversePairTaskTrackV0Extended {
285329
}
286330
}
287331

288-
PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEvent, "Enable processing mixed events", true);
332+
PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEvent, "Enable processing mixed events for track - V0", false);
333+
334+
/// This function processes the mixed event for V0 - V0
335+
void processMixedEventV0(o2::aod::FDCollisions& cols, FemtoFullParticles& parts)
336+
{
337+
ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{ConfVtxBins, ConfMultBins}, true};
338+
339+
for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) {
340+
341+
const int multCol = collision1.multNtr();
342+
343+
auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
344+
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
345+
346+
const auto& magFieldTesla1 = collision1.magField();
347+
const auto& magFieldTesla2 = collision2.magField();
348+
349+
if (magFieldTesla1 != magFieldTesla2) {
350+
continue;
351+
}
352+
353+
for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) {
354+
if (ConfIsCPR.value) {
355+
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1)) {
356+
continue;
357+
}
358+
}
359+
// track cleaning
360+
if (!pairCleaner.isCleanPair(p1, p2, parts)) {
361+
continue;
362+
}
363+
const auto& posChild = parts.iteratorAt(p2.index() - 2);
364+
const auto& negChild = parts.iteratorAt(p2.index() - 1);
365+
if ((ConfV0Type > 0 && !IsParticleTPC(posChild, 0)) || (ConfV0Type < 0 && !IsParticleTPC(negChild, 0)))
366+
continue;
367+
mixedEventCont.setPair<false>(p1, p2, multCol, ConfUse3D);
368+
}
369+
}
370+
}
371+
372+
PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEventV0, "Enable processing mixed events for V0 - V0", false);
289373
};
290374

291375
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)