|
12 | 12 | /// \file DecayChannels.h |
13 | 13 | /// \brief Definitions of constants for MC flagging of HF decay channels. |
14 | 14 | /// \author Vít Kučera <vit.kucera@cern.ch>, Inha University |
15 | | -/// \author Marcello Di Costanzo <marcello.di.costanzo@cern.ch>, Polytechnic University of Turin and INFN |
16 | 15 | /// \note DecayChannelMain enums define unique combinations of the mother and the daughters for main channels. |
17 | 16 | /// \note DecayChannelResonant enums define unique combinations of the mother and the daughters for resonant channels. |
18 | 17 | /// \note Value 0 is reserved to indicate no match. |
|
21 | 20 | #ifndef PWGHF_CORE_DECAYCHANNELS_H_ |
22 | 21 | #define PWGHF_CORE_DECAYCHANNELS_H_ |
23 | 22 |
|
24 | | -#include <array> |
25 | 23 | #include <cstdint> |
26 | | -#include <unordered_map> |
27 | | -#include <vector> |
28 | | - |
29 | | -using namespace o2::constants::physics; |
30 | 24 |
|
31 | 25 | namespace o2::hf_decay |
32 | 26 | { |
@@ -59,24 +53,6 @@ enum DecayChannelResonant : int8_t { |
59 | 53 | // |
60 | 54 | LastChannelResonant |
61 | 55 | }; |
62 | | - |
63 | | -std::unordered_map<DecayChannelMain, std::vector<int>> finalStates2Prongs = |
64 | | - { |
65 | | - {DecayChannelMain::D0ToPiK, std::vector<int>{+kKMinus, +kPiPlus}}, |
66 | | - {DecayChannelMain::D0ToPiKPi0, std::vector<int>{+kKMinus, +kPiPlus, +kPi0}}, |
67 | | - {DecayChannelMain::D0ToPiPi, std::vector<int>{+kPiMinus, +kPiPlus}}, |
68 | | - {DecayChannelMain::D0ToPiPiPi0, std::vector<int>{+kPiMinus, +kPiPlus, +kPi0}}, |
69 | | - {DecayChannelMain::D0ToKK, std::vector<int>{+kKMinus, +kKPlus}}, |
70 | | -}; |
71 | | - |
72 | | -std::unordered_map<DecayChannelResonant, std::array<int, 2>> resoStatesD0 = |
73 | | - { |
74 | | - {DecayChannelResonant::D0ToRhoplusPi, std::array<int, 2>{213, +kPiMinus}}, |
75 | | - {DecayChannelResonant::D0ToRhoplusK, std::array<int, 2>{213, +kKMinus}}, |
76 | | - {DecayChannelResonant::D0ToKstar0Pi0, std::array<int, 2>{-kK0Star892, +kPi0}}, |
77 | | - {DecayChannelResonant::D0ToKstarPi, std::array<int, 2>{-kKPlusStar892, +kPiPlus}}, |
78 | | -}; |
79 | | - |
80 | 56 | } // namespace hf_cand_2prong |
81 | 57 |
|
82 | 58 | namespace hf_cand_3prong |
@@ -152,100 +128,6 @@ enum DecayChannelResonant : int8_t { |
152 | 128 | // |
153 | 129 | LastChannelResonant |
154 | 130 | }; |
155 | | - |
156 | | -std::unordered_map<DecayChannelResonant, std::array<int, 2>> resoStatesDPlus = |
157 | | - { |
158 | | - {DecayChannelResonant::DplusToPhiPi, std::array<int, 2>{+kPhi, +kPiPlus}}, |
159 | | - {DecayChannelResonant::DplusToKstar0K, std::array<int, 2>{-kK0Star892, +kKPlus}}, |
160 | | - {DecayChannelResonant::DplusToKstar1430_0K, std::array<int, 2>{+10311, +kKPlus}}, |
161 | | - {DecayChannelResonant::DplusToRho0Pi, std::array<int, 2>{+113, +kPiPlus}}, |
162 | | - {DecayChannelResonant::DplusToF2_1270Pi, std::array<int, 2>{+225, +kPiPlus}}, |
163 | | -}; |
164 | | - |
165 | | -std::unordered_map<DecayChannelMain, std::vector<int>> finalStatesDPlus = |
166 | | - { |
167 | | - {DecayChannelMain::DplusToPiKPi, std::vector<int>{+kKMinus, +kKPlus, +kPiPlus}}, |
168 | | - {DecayChannelMain::DplusToPiKK, std::vector<int>{+kKMinus, +kPiPlus, +kPiPlus}}, |
169 | | - {DecayChannelMain::DplusToPiKPiPi0, std::vector<int>{+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, |
170 | | - {DecayChannelMain::DplusToPiPiPi, std::vector<int>{+kPiMinus, +kPiPlus, +kPiPlus}}, |
171 | | -}; |
172 | | - |
173 | | -// Ds± → K± K∓ π± |
174 | | -std::unordered_map<DecayChannelResonant, std::array<int, 2>> resoStatesDs = |
175 | | - { |
176 | | - {DecayChannelResonant::DsToPhiPi, std::array<int, 2>{+kPhi, +kPiPlus}}, |
177 | | - {DecayChannelResonant::DsToPhiRhoplus, std::array<int, 2>{+kPhi, +213}}, |
178 | | - {DecayChannelResonant::DsToKstar0K, std::array<int, 2>{-kK0Star892, +kKPlus}}, |
179 | | - {DecayChannelResonant::DsToKstar0Pi, std::array<int, 2>{+kK0Star892, +kPiPlus}}, |
180 | | - {DecayChannelResonant::DsToRho0Pi, std::array<int, 2>{113, +kPiPlus}}, |
181 | | - {DecayChannelResonant::DsToRho0K, std::array<int, 2>{113, +kKPlus}}, |
182 | | - {DecayChannelResonant::DsToF2_1270Pi, std::array<int, 2>{225, +kPiPlus}}, |
183 | | - {DecayChannelResonant::DsToF0_1370K, std::array<int, 2>{10221, +kKPlus}}, |
184 | | - {DecayChannelResonant::DsToEtaPi, std::array<int, 2>{221, +kPiPlus}}, |
185 | | -}; |
186 | | - |
187 | | -std::unordered_map<DecayChannelMain, std::vector<int>> finalStatesDs = |
188 | | - { |
189 | | - {DecayChannelMain::DsToPiKK, std::vector<int>{+kKMinus, +kKPlus, +kPiPlus}}, |
190 | | - {DecayChannelMain::DsToPiKKPi0, std::vector<int>{+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, |
191 | | - {DecayChannelMain::DsToPiPiK, std::vector<int>{+kKPlus, +kPiPlus, +kPiMinus}}, |
192 | | - {DecayChannelMain::DsToPiPiPi, std::vector<int>{+kPiMinus, +kPiPlus, +kPiPlus}}, |
193 | | - {DecayChannelMain::DsToPiPiPiPi0, std::vector<int>{+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, |
194 | | -}; |
195 | | - |
196 | | -// Dstar → K± K∓ π± |
197 | | -std::unordered_map<DecayChannelResonant, std::array<int, 2>> resoStatesDstar = |
198 | | - { |
199 | | - {DecayChannelResonant::DstarToD0ToRhoplusPi, std::array<int, 2>{213, +kPiMinus}}, |
200 | | - {DecayChannelResonant::DstarToD0ToRhoplusK, std::array<int, 2>{213, +kKMinus}}, |
201 | | - {DecayChannelResonant::DstarToD0ToKstar0Pi0, std::array<int, 2>{-kK0Star892, +kPi0}}, |
202 | | - {DecayChannelResonant::DstarToD0ToKstarPi, std::array<int, 2>{-kKPlusStar892, +kPiPlus}}, |
203 | | - {DecayChannelResonant::DstarToDplusToPhiPi, std::array<int, 2>{+kPhi, +kPiPlus}}, |
204 | | - {DecayChannelResonant::DstarToDplusToKstar0K, std::array<int, 2>{-kK0Star892, +kKPlus}}, |
205 | | - {DecayChannelResonant::DstarToDplusToKstar1430_0K, std::array<int, 2>{+10311, +kKPlus}}, |
206 | | - {DecayChannelResonant::DstarToDplusToRho0Pi, std::array<int, 2>{+113, +kPiPlus}}, |
207 | | - {DecayChannelResonant::DstarToDplusToF2_1270Pi, std::array<int, 2>{+225, +kPiPlus}}, |
208 | | -}; |
209 | | - |
210 | | -std::unordered_map<DecayChannelMain, std::vector<int>> finalStatesDstar = |
211 | | - { |
212 | | - {DecayChannelMain::DstarToPiKPi, std::vector<int>{+kKMinus, +kPiPlus, +kPiPlus}}, |
213 | | - {DecayChannelMain::DstarToPiKPiPi0, std::vector<int>{+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, |
214 | | - {DecayChannelMain::DstarToPiKPiPi0Pi0, std::vector<int>{+kKMinus, +kPiPlus, +kPiPlus, +kPi0, +kPi0}}, |
215 | | - {DecayChannelMain::DstarToPiKK, std::vector<int>{+kKMinus, +kKPlus, +kPiPlus}}, |
216 | | - {DecayChannelMain::DstarToPiKKPi0, std::vector<int>{+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, |
217 | | - {DecayChannelMain::DstarToPiPiPi, std::vector<int>{+kPiMinus, +kPiPlus, +kPiPlus}}, |
218 | | - {DecayChannelMain::DstarToPiPiPiPi0, std::vector<int>{+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, |
219 | | -}; |
220 | | - |
221 | | -// Lc → p K∓ π± |
222 | | -std::unordered_map<DecayChannelResonant, std::array<int, 2>> resoStatesLambdaC = |
223 | | - { |
224 | | - {DecayChannelResonant::LcToPKstar0, std::array<int, 2>{+kK0Star892, +kProton}}, |
225 | | - {DecayChannelResonant::LcToDeltaplusplusK, std::array<int, 2>{+2224, +kKMinus}}, |
226 | | - {DecayChannelResonant::LcToL1520Pi, std::array<int, 2>{+102134, +kPiPlus}}, |
227 | | -}; |
228 | | - |
229 | | -std::unordered_map<DecayChannelMain, std::vector<int>> finalStatesLc = |
230 | | - { |
231 | | - {DecayChannelMain::LcToPKPi, std::vector<int>{+kProton, +kKMinus, +kPiPlus}}, |
232 | | - {DecayChannelMain::LcToPKPiPi0, std::vector<int>{+kProton, +kKMinus, +kPiPlus, +kPi0}}, |
233 | | - {DecayChannelMain::LcToPPiPi, std::vector<int>{+kProton, +kPiMinus, +kPiPlus}}, |
234 | | - {DecayChannelMain::LcToPKK, std::vector<int>{+kProton, +kKMinus, +kKPlus}}}; |
235 | | - |
236 | | -// Xic → p K∓ π± |
237 | | -std::unordered_map<DecayChannelResonant, std::array<int, 2>> resoStatesXiC = |
238 | | - { |
239 | | - {DecayChannelResonant::XicToPKstar0, std::array<int, 2>{-kK0Star892, +kProton}}, |
240 | | - {DecayChannelResonant::XicToPPhi, std::array<int, 2>{+kProton, +kPhi}}, |
241 | | -}; |
242 | | - |
243 | | -std::unordered_map<DecayChannelMain, std::vector<int>> finalStatesXic = |
244 | | - { |
245 | | - {DecayChannelMain::XicToPKPi, std::vector<int>{+kProton, +kKMinus, +kPiPlus}}, |
246 | | - {DecayChannelMain::XicToPKK, std::vector<int>{+kProton, +kKMinus, +kKPlus}}, |
247 | | - {DecayChannelMain::XicToSPiPi, std::vector<int>{+kSigmaPlus, +kPiMinus, +kPiPlus}}, |
248 | | -}; |
249 | 131 | } // namespace hf_cand_3prong |
250 | 132 |
|
251 | 133 | namespace hf_cand_dstar |
@@ -335,108 +217,4 @@ enum DecayChannelToJpsiResonant : int8_t { |
335 | 217 | } // namespace hf_cand_beauty |
336 | 218 | } // namespace o2::hf_decay |
337 | 219 |
|
338 | | -namespace o2::hf_corrbkg |
339 | | -{ |
340 | | -using namespace o2::hf_decay; |
341 | | - |
342 | | -/// Returns a map of the possible final states for a specific 3-prong particle specie |
343 | | -/// \param pdgMother PDG code of the mother particle |
344 | | -/// \return a map of final states with their corresponding PDG codes |
345 | | -std::unordered_map<hf_cand_3prong::DecayChannelMain, std::vector<int>> getDecayChannel3Prong(int pdgMother) |
346 | | -{ |
347 | | - switch (pdgMother) { |
348 | | - case Pdg::kDPlus: |
349 | | - return hf_cand_3prong::finalStatesDPlus; |
350 | | - case Pdg::kDS: |
351 | | - return hf_cand_3prong::finalStatesDs; |
352 | | - case Pdg::kDStar: |
353 | | - return hf_cand_3prong::finalStatesDstar; |
354 | | - case Pdg::kLambdaCPlus: |
355 | | - return hf_cand_3prong::finalStatesLc; |
356 | | - case Pdg::kXiCPlus: |
357 | | - return hf_cand_3prong::finalStatesXic; |
358 | | - default: |
359 | | - LOG(error) << "Unknown PDG code for 3-prong final states: " << pdgMother; |
360 | | - return {}; |
361 | | - } |
362 | | -} |
363 | | - |
364 | | -/// Returns a map of the resonant decay channels for a specific 3-prong particle specie |
365 | | -/// \param pdgMother PDG code of the mother particle |
366 | | -/// \return a map of resonant decay channels with their corresponding PDG codes |
367 | | -std::unordered_map<hf_cand_3prong::DecayChannelResonant, std::array<int, 2>> getResoChannels3Prong(int pdgMother) |
368 | | -{ |
369 | | - switch (pdgMother) { |
370 | | - case Pdg::kDPlus: |
371 | | - return hf_cand_3prong::resoStatesDPlus; |
372 | | - case Pdg::kDS: |
373 | | - return hf_cand_3prong::resoStatesDs; |
374 | | - case Pdg::kDStar: |
375 | | - return hf_cand_3prong::resoStatesDstar; |
376 | | - case Pdg::kLambdaCPlus: |
377 | | - return hf_cand_3prong::resoStatesLambdaC; |
378 | | - case Pdg::kXiCPlus: |
379 | | - return hf_cand_3prong::resoStatesXiC; |
380 | | - default: |
381 | | - LOG(error) << "Unknown PDG code for 3-prong final states: " << pdgMother; |
382 | | - return {}; |
383 | | - } |
384 | | -} |
385 | | - |
386 | | -/// Perform the matching for a single resonant channel |
387 | | -/// \tparam N size of the array of daughter PDG codes |
388 | | -/// \param arrPdgResoChn array of daughter indices |
389 | | -/// \param arrPdgDaugs array of PDG codes for the resonant decay |
390 | | -/// \return true if the resonant channel is matched, false otherwise |
391 | | -template <std::size_t N> |
392 | | -bool checkResonantDecay(std::array<int, N> arrPdgResoChn, std::array<int, N> arrPdgDaugs) |
393 | | -{ |
394 | | - for (size_t i = 0; i < N; i++) { |
395 | | - bool findDaug = false; |
396 | | - for (size_t j = 0; j < N; j++) { |
397 | | - if (std::abs(arrPdgResoChn[i]) == std::abs(arrPdgDaugs[j])) { |
398 | | - arrPdgDaugs[j] = -1; // Mark as found |
399 | | - findDaug = true; |
400 | | - break; |
401 | | - } |
402 | | - } |
403 | | - if (!findDaug) { |
404 | | - return false; |
405 | | - } |
406 | | - } |
407 | | - return true; |
408 | | -} |
409 | | - |
410 | | -/// Flag the resonant decays |
411 | | -/// Function documentation: |
412 | | -/// \tparam is3Prong bool to specify if the mother decays with a 3-prong decay |
413 | | -/// \tparam N size of the array of daughter PDG codes |
414 | | -/// \param motherPdg PDG code of the mother particle |
415 | | -/// \param channel decay channel flag to be set |
416 | | -/// \param arrDaughPdgs array of daughter PDG codes |
417 | | -template <bool is3Prong = false, std::size_t N> |
418 | | -void flagResonantDecay(int motherPdg, int8_t* channel, std::array<int, N> arrDaughPdgs) |
419 | | -{ |
420 | | - if constexpr (is3Prong) { |
421 | | - std::unordered_map<hf_cand_3prong::DecayChannelResonant, std::array<int, 2>> resoStates = getResoChannels3Prong(motherPdg); |
422 | | - for (const auto& [flag, pdgCodes] : resoStates) { |
423 | | - if (checkResonantDecay(arrDaughPdgs, pdgCodes)) { |
424 | | - *channel = flag; |
425 | | - break; |
426 | | - } |
427 | | - } |
428 | | - } else { |
429 | | - if (motherPdg != Pdg::kD0) { |
430 | | - return; |
431 | | - } |
432 | | - for (const auto& [flag, pdgCodes] : hf_cand_2prong::resoStatesD0) { |
433 | | - if (checkResonantDecay(arrDaughPdgs, pdgCodes)) { |
434 | | - *channel = flag; |
435 | | - break; |
436 | | - } |
437 | | - } |
438 | | - } |
439 | | -} |
440 | | -} // namespace o2::hf_corrbkg |
441 | | - |
442 | 220 | #endif // PWGHF_CORE_DECAYCHANNELS_H_ |
0 commit comments