Skip to content

Commit 6ce0035

Browse files
author
David Dobrigkeit Chinellato
committed
Add de-duplication alternatives
1 parent fdd6eaa commit 6ce0035

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ struct StrangenessBuilder {
275275

276276
// first order deduplication implementation
277277
// more algorithms to be added as necessary
278-
Configurable<int> deduplicationAlgorithm{"deduplicationAlgorithm", 1, "0: disabled; 1: best pointing angle wins"};
278+
Configurable<int> deduplicationAlgorithm{"deduplicationAlgorithm", 1, "0: disabled; 1: best pointing angle wins; 2: best DCA daughters wins; 3: best pointing and best DCA wins"};
279279

280280
// V0 buffer for V0s used in cascades: master switch
281281
// exchanges CPU (generate V0s again) with memory (save pre-generated V0s)
@@ -784,6 +784,9 @@ struct StrangenessBuilder {
784784
float bestPointingAngle = 10; // a nonsense angle, anything's better
785785
size_t bestPointingAngleIndex = -1;
786786

787+
float bestDCADaughters = 1e+3; // an excessively large DCA
788+
size_t bestDCADaughtersIndex = -1;
789+
787790
for (size_t ic = 0; ic < v0tableGrouped[iV0].collisionIds.size(); ic++) {
788791
// get track parametrizations, collisions
789792
auto posTrackPar = getTrackParCov(pTrack);
@@ -819,13 +822,24 @@ struct StrangenessBuilder {
819822
bestPointingAngle = straHelper.v0.pointingAngle;
820823
bestPointingAngleIndex = ic;
821824
}
825+
if (straHelper.v0.daughterDCA < bestDCADaughters) {
826+
bestDCADaughters = straHelper.v0.daughterDCA;
827+
bestDCADaughtersIndex = ic;
828+
}
822829
} // end build V0
823830
} // end candidate loop
824831

825832
// mark de-duplicated candidates
826833
for (size_t ic = 0; ic < v0tableGrouped[iV0].collisionIds.size(); ic++) {
827834
ao2dV0toV0List[v0tableGrouped[iV0].V0Ids[ic]] = -2;
828-
if (bestPointingAngleIndex == ic) {
835+
// algorithm 1: best pointing angle
836+
if (bestPointingAngleIndex == ic && deduplicationAlgorithm.value==1) {
837+
ao2dV0toV0List[v0tableGrouped[iV0].V0Ids[ic]] = -1; // keep best only
838+
}
839+
if (bestDCADaughtersIndex == ic && deduplicationAlgorithm.value==2) {
840+
ao2dV0toV0List[v0tableGrouped[iV0].V0Ids[ic]] = -1; // keep best only
841+
}
842+
if (bestDCADaughtersIndex == ic && bestPointingAngleIndex == ic && deduplicationAlgorithm.value==3) {
829843
ao2dV0toV0List[v0tableGrouped[iV0].V0Ids[ic]] = -1; // keep best only
830844
}
831845
}

0 commit comments

Comments
 (0)