ml_pid_cbm.tools.particles_id

Moudule with enum of known PID in MONTE CARLO PARTICLE NUMBERING SCHEME More details: https://pdg.lbl.gov/2007/reviews/montecarlorpp.pdf

 1"""
 2Moudule with enum of known PID in MONTE CARLO PARTICLE NUMBERING SCHEME
 3More details: https://pdg.lbl.gov/2007/reviews/montecarlorpp.pdf
 4"""
 5
 6from enum import Enum
 7
 8
 9class ParticlesId(Enum):
10    """
11    Enum class containg known PID in Monte Carlo format
12    """
13
14    POSITRON = -11.0
15    ELECTRON = 11.0
16    PROTON = 2212.0
17    ANTI_PROTON = -2212.0
18    NEG_MUON = -13.0
19    POS_MUON = 13.0
20    NEG_PION = -211.0
21    POS_PION = 211.0
22    NEG_KAON = -321.0
23    POS_KAON = 321.0
24
25    @classmethod
26    def is_known_particle(cls, pid: float) -> bool:
27        """hecks if given pid is a known particle in this class
28
29        Args:
30            pid (float): Pid to be checked if in list
31
32        Returns:
33            bool: Returns True, if given pid belongs to class
34        """
35        return pid in cls._value2member_map_
class ParticlesId(enum.Enum):
10class ParticlesId(Enum):
11    """
12    Enum class containg known PID in Monte Carlo format
13    """
14
15    POSITRON = -11.0
16    ELECTRON = 11.0
17    PROTON = 2212.0
18    ANTI_PROTON = -2212.0
19    NEG_MUON = -13.0
20    POS_MUON = 13.0
21    NEG_PION = -211.0
22    POS_PION = 211.0
23    NEG_KAON = -321.0
24    POS_KAON = 321.0
25
26    @classmethod
27    def is_known_particle(cls, pid: float) -> bool:
28        """hecks if given pid is a known particle in this class
29
30        Args:
31            pid (float): Pid to be checked if in list
32
33        Returns:
34            bool: Returns True, if given pid belongs to class
35        """
36        return pid in cls._value2member_map_

Enum class containg known PID in Monte Carlo format

POSITRON = <ParticlesId.POSITRON: -11.0>
ELECTRON = <ParticlesId.ELECTRON: 11.0>
PROTON = <ParticlesId.PROTON: 2212.0>
ANTI_PROTON = <ParticlesId.ANTI_PROTON: -2212.0>
NEG_MUON = <ParticlesId.NEG_MUON: -13.0>
POS_MUON = <ParticlesId.POS_MUON: 13.0>
NEG_PION = <ParticlesId.NEG_PION: -211.0>
POS_PION = <ParticlesId.POS_PION: 211.0>
NEG_KAON = <ParticlesId.NEG_KAON: -321.0>
POS_KAON = <ParticlesId.POS_KAON: 321.0>
@classmethod
def is_known_particle(cls, pid: float) -> bool:
26    @classmethod
27    def is_known_particle(cls, pid: float) -> bool:
28        """hecks if given pid is a known particle in this class
29
30        Args:
31            pid (float): Pid to be checked if in list
32
33        Returns:
34            bool: Returns True, if given pid belongs to class
35        """
36        return pid in cls._value2member_map_

hecks if given pid is a known particle in this class

Args: pid (float): Pid to be checked if in list

Returns: bool: Returns True, if given pid belongs to class

Inherited Members
enum.Enum
name
value