|
21 | 21 | #include "PWGJE/Core/JetDerivedDataUtilities.h" |
22 | 22 | #include "PWGJE/Core/JetHFUtilities.h" |
23 | 23 | #include "PWGJE/Core/JetUtilities.h" |
| 24 | +#include "PWGJE/Core/JetHFUtilities.h" |
24 | 25 | #include "PWGJE/DataModel/Jet.h" |
25 | 26 | #include "PWGJE/DataModel/JetReducedData.h" |
26 | 27 |
|
@@ -464,6 +465,28 @@ struct HfFragmentationFunction { |
464 | 465 | selectedAs = -1; |
465 | 466 | } |
466 | 467 |
|
| 468 | + // reflection information for storage: HF = +1, HFbar = -1, neither = 0 |
| 469 | + int matchedFrom = 0; |
| 470 | + int decayChannel = 0; |
| 471 | + if (jethfutilities::isD0Table<TCandidatesMCD>()) { |
| 472 | + decayChannel = o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; |
| 473 | + } else if (jethfutilities::isLcTable<TCandidatesMCD>()) { |
| 474 | + decayChannel = o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; |
| 475 | + } |
| 476 | + int selectedAs = 0; |
| 477 | + |
| 478 | + if (mcdcand.flagMcMatchRec() == decayChannel) { // matched to HF on truth level |
| 479 | + matchedFrom = 1; |
| 480 | + } else if (mcdcand.flagMcMatchRec() == -decayChannel) { // matched to HFbar on truth level |
| 481 | + matchedFrom = -1; |
| 482 | + } |
| 483 | + // bitwise AND operation: Checks whether BIT(i) is set, regardless of other bits |
| 484 | + if (mcdcand.candidateSelFlag() & BIT(0)) { // CandidateSelFlag == BIT(0) -> selected as HF |
| 485 | + selectedAs = 1; |
| 486 | + } else if (mcdcand.candidateSelFlag() & BIT(1)) { // CandidateSelFlag == BIT(1) -> selected as HFbar |
| 487 | + selectedAs = -1; |
| 488 | + } |
| 489 | + |
467 | 490 | // store matched particle and detector level data in one single table (calculate angular distance in eta-phi plane on the fly) |
468 | 491 | matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as<aod::JetParticles>().size(), // particle level jet |
469 | 492 | mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF |
|
0 commit comments