Skip to content

Commit d8cef62

Browse files
Added collision selection from jetderiveddatautilities for MC collisions too.
1 parent 790959e commit d8cef62

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

PWGJE/Tasks/hfFragmentationFunction.cxx

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,7 @@
2525
#include "PWGJE/Core/JetUtilities.h"
2626
#include "PWGJE/DataModel/Jet.h"
2727
#include "PWGJE/DataModel/JetReducedData.h"
28-
<<<<<<< HEAD
29-
=======
3028

31-
<<<<<<< HEAD
32-
#include "PWGHF/Core/DecayChannels.h"
33-
>>>>>>> 8fcbef4d9 (Fix: clang-formatting done manually)
34-
35-
=======
36-
>>>>>>> ee38d6bf6 (Fix: formatting with automatic git-clang-format feature)
3729
#include "Common/Core/RecoDecay.h"
3830

3931
#include "Framework/ASoA.h"
@@ -329,7 +321,7 @@ struct HfFragmentationFunction {
329321

330322
registry.fill(HIST("h_collision_counter"), 0.0);
331323
// skip collisions outside of |z| < vertexZCut
332-
if (std::abs(mccollision.posZ()) > vertexZCut) {
324+
if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) {
333325
continue;
334326
}
335327
registry.fill(HIST("h_collision_counter"), 1.0);
@@ -420,7 +412,7 @@ struct HfFragmentationFunction {
420412
for (const auto& mccollision : mccollisions) {
421413
registry.fill(HIST("h_collision_counter"), 0.0);
422414
// skip collisions outside of |z| < vertexZCut
423-
if (std::abs(mccollision.posZ()) > vertexZCut) {
415+
if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) {
424416
continue;
425417
}
426418
registry.fill(HIST("h_collision_counter"), 1.0);
@@ -462,28 +454,6 @@ struct HfFragmentationFunction {
462454
}
463455
int selectedAs = 0;
464456

465-
if (mcdcand.flagMcMatchRec() == decayChannel) { // matched to HF on truth level
466-
matchedFrom = 1;
467-
} else if (mcdcand.flagMcMatchRec() == -decayChannel) { // matched to HFbar on truth level
468-
matchedFrom = -1;
469-
}
470-
// bitwise AND operation: Checks whether BIT(i) is set, regardless of other bits
471-
if (mcdcand.candidateSelFlag() & BIT(0)) { // CandidateSelFlag == BIT(0) -> selected as HF
472-
selectedAs = 1;
473-
} else if (mcdcand.candidateSelFlag() & BIT(1)) { // CandidateSelFlag == BIT(1) -> selected as HFbar
474-
selectedAs = -1;
475-
}
476-
477-
// reflection information for storage: HF = +1, HFbar = -1, neither = 0
478-
int matchedFrom = 0;
479-
int decayChannel = 0;
480-
if (jethfutilities::isD0Table<TCandidatesMCD>()) {
481-
decayChannel = o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK;
482-
} else if (jethfutilities::isLcTable<TCandidatesMCD>()) {
483-
decayChannel = o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi;
484-
}
485-
int selectedAs = 0;
486-
487457
if (mcdcand.flagMcMatchRec() == decayChannel) { // matched to HF on truth level
488458
matchedFrom = 1;
489459
} else if (mcdcand.flagMcMatchRec() == -decayChannel) { // matched to HFbar on truth level

0 commit comments

Comments
 (0)