File indexing completed on 2026-08-06 09:38:29
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ThePEG_PID_H
0010 #define ThePEG_PID_H
0011
0012 #include "EnumParticles.h"
0013
0014 namespace ThePEG {
0015
0016
0017
0018
0019
0020
0021
0022
0023 class PID {
0024 public:
0025
0026
0027
0028 template <typename T>
0029 PID(T t) {
0030 t.ERROR_only_use_long_as_Particle_ID_type();
0031 }
0032
0033
0034
0035
0036 template <typename T>
0037 operator T() const {
0038 T t;
0039 t.ERROR_only_use_long_as_Particle_ID_type();
0040 return t;
0041 }
0042
0043
0044
0045
0046 PID operator-() const;
0047
0048 private:
0049
0050
0051
0052 long id;
0053 };
0054
0055
0056 template <> inline PID::PID(long t) : id(t) {}
0057
0058
0059 template <> inline PID::PID(int t) : id(t) {}
0060
0061
0062 template <> inline PID::PID(ParticleID::ParticleCodes t) : id(t) {}
0063
0064
0065 template <> inline PID::operator long() const { return id; }
0066
0067
0068
0069
0070 inline PID PID::operator-() const {
0071 return -id;
0072 }
0073
0074 }
0075
0076 #endif