OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
ParticleProperties.h
Go to the documentation of this file.
1//
2// Class ParticleProperties
3// Base class for representing particle properties
4//
5// Copyright (c) 2021, Pedro Calvo, CIEMAT, Spain
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#ifndef PARTICLEPROPERTIES_H
19#define PARTICLEPROPERTIES_H
20
21#include "Utilities/BiMap.h"
22
23#include <map>
24#include <string>
25
26enum class ParticleType : short {
27 UNNAMED = -1,
28 PHOTON,
31 MUON,
32 PION,
33 PROTON,
36 HMINUS,
38 H2P,
39 H3P,
40 ALPHA,
41 CARBON,
42 XENON,
44};
45
46enum class ParticleOrigin : unsigned short { REGULAR, SECONDARY, STRIPPED };
47
49public:
50 static ParticleType getParticleType(const std::string& str);
51
52 static std::string getParticleTypeString(const ParticleType& type);
53
54 static double getParticleMass(const ParticleType& type);
55
56 static double getParticleCharge(const ParticleType& type);
57 static double getParticleChargeInCoulomb(const ParticleType& type);
58
60 static double getParticleLifetime(const ParticleType& type);
61
64 static double getParticleAnomaly(const ParticleType& type);
65
66private:
68
69 static const std::map<ParticleType, double> particleMass_m;
70 static const std::map<ParticleType, double> particleCharge_m;
71 static const std::map<ParticleType, double> particleLifetime_m;
72};
74#endif /* PARTICLEPROPERTIES_H */
ParticleOrigin
Simple bidirectional map with lookup in both directions.
Definition BiMap.h:28
static std::string getParticleTypeString(const ParticleType &type)
static double getParticleMass(const ParticleType &type)
static const std::map< ParticleType, double > particleCharge_m
static const BiMap< ParticleType, std::string > bmParticleType_s
static double getParticleCharge(const ParticleType &type)
static const std::map< ParticleType, double > particleMass_m
static double getParticleAnomaly(const ParticleType &type)
static double getParticleChargeInCoulomb(const ParticleType &type)
static double getParticleLifetime(const ParticleType &type)
Return the mean rest-frame lifetime [s]. Throws if the particle is stable.
static const std::map< ParticleType, double > particleLifetime_m
static ParticleType getParticleType(const std::string &str)