CbmRoot
Loading...
Searching...
No Matches
KfpV0FinderDefs.h
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#ifndef KfpV0FinderDefs_h
11#define KfpV0FinderDefs_h 1
12
13#include "CbmEnumDict.h"
14
15#include <array>
16
17namespace cbm::algo::kfp
18{
21 // TODO: extend
22 // NOTE: a limited number of particles can be assigned to tracks
23 // NOTE: ETrackPid::Undef defines the size of the enum and ALWAYS must be the last element
24 enum class ETrackPid
25 {
26 Pip = 0,
28 P,
31 };
32
35 static constexpr int ToPdg(ETrackPid trackPid)
36 {
37 constexpr std::array<int, static_cast<size_t>(ETrackPid::Undef) + 1> mapper = {
38 +211, // ETrackPid::Pip
39 -211, // ETrackPid::Pim
40 +2212, // ETrackPid::P
41 -2212, // ETrackPid::Pbar
42 -2, // ETrackPid::Undef
43 };
44 return mapper[static_cast<size_t>(trackPid)];
45 }
46
49 static constexpr ETrackPid ToTrackPid(int pdg)
50 {
51 switch (pdg) {
52 case +211: return ETrackPid::Pip;
53 case -211: return ETrackPid::Pim;
54 case +2212: return ETrackPid::P;
55 case -2212: return ETrackPid::Pbar;
56 default: return ETrackPid::Undef;
57 }
58 return ETrackPid::Undef;
59 }
60
62 std::string ToString(ETrackPid trackPid);
63
66 enum class EV0Type
67 {
69 };
70} // namespace cbm::algo::kfp
71
82
83#endif // KfpV0FinderDefs_h
#define CBM_ENUM_DICT(type,...)
ETrackPid
An enumeration for PID of global tracks.
std::string ToString(ETrackPid trackPid)
String representation of ETrackPid.
ETrackPid
An enumeration for PID of global tracks.
EV0Type
Type of V0 decay.
static constexpr ETrackPid ToTrackPid(int pdg)
Converts PDG code into ETrackPid entry.
static constexpr int ToPdg(ETrackPid trackPid)
Returns PDG code for a given ETrackPid entry.