thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
PDT.h
1// -*- C++ -*-
2//
3// PDT.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 Leif Lonnblad
5//
6// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef ThePEG_PDT_H
10#define ThePEG_PDT_H
11// This is the declaration of the PDT class.
12
14
15namespace ThePEG {
16
24class PDT {
25
26public:
27
32 enum Spin {
33 SpinNA = -1,
36 Spin0 = 1,
38 Spin1 = 3,
40 Spin2 = 5,
42 Spin3 = 7,
44 Spin4 = 9
45 };
46
51 enum Charge {
52 ChargeUnknown = -999999,
53 ChargeUndefined = -999999,
54 Charged = 999990,
55 Positive = 900000,
56 Negative = -900000,
58 Charge0 = 0,
61 Plus1 = 3,
64 Minus1 = -3,
67 Plus2 = 6,
70 Minus2 = -6,
73 Plus3 = 9,
76 Minus3 = -9,
77 Plus4 = 12,
78 Plus5 = 15,
79 Plus6 = 18,
80 Plus7 = 21,
81 Plus8 = 24,
82 Minus4 = -12,
83 Minus5 = -15,
84 Minus6 = -18,
85 Minus7 = -21,
86 Minus8 = -24
87 };
88
92 enum Colour {
96 Colour0 = 0,
98 Colour3 = 3,
102 Colour8 = 8
103 };
104
109 ColouredUnknown = -2,
110 ColouredUndefined = -2,
111 NotColoured = -1,
112 ColouredQCD = 0
113 };
114
118 static bool charged(Charge c) {
119 return c != ChargeNeutral && c != ChargeUndefined;
120 }
121
125 static bool positive(Charge c) {
126 return c > ChargeNeutral && c != Charged;
127 }
128
132 static bool negative(Charge c) {
133 return c < ChargeNeutral && c != ChargeUndefined;
134 }
135
139 static bool coloured(Colour c) {
140 return c != ColourNeutral && c != ColourUnknown;
141 }
142
147 if ( c == Colour3 || c == Colour3bar ) return Colour(-c);
148 if ( c == Colour6 || c == Colour6bar ) return Colour(-c);
149 return c;
150 }
151
157 static vector<long> flavourContent(long id);
158
164 static vector<long> flavourContent(tcPDPtr);
165
171 static vector<long> flavourContent(tcPPtr);
172
178 static vector<long> flavourContent(const ParticleData &);
179
185 static vector<long> flavourContent(const Particle &);
186
187};
188
190template <typename IStream>
191IStream & operator>>(IStream & is, PDT::Colour & c) {
192 int ci;
193 is >> ci;
194 c = PDT::Colour(ci);
195 return is;
196}
197
199template <typename IStream>
200IStream & operator>>(IStream & is, PDT::Charge & c) {
201 int ci;
202 is >> ci;
203 c = PDT::Charge(ci);
204 return is;
205}
206
208template <typename IStream>
209IStream & operator>>(IStream & is, PDT::Spin & s) {
210 int si;
211 is >> si;
212 s = PDT::Spin(si);
213 return is;
214}
215
217template <>
218struct TypeTraits<PDT::Spin>
219{
221 enum { hasDimension = false };
223 typedef EnumT DimType;
225 static constexpr PDT::Spin baseunit() { return PDT::Spin(1); }
226};
227
229template <>
231{
233 enum { hasDimension = false };
235 typedef EnumT DimType;
237 static constexpr PDT::Charge baseunit() { return PDT::Charge(1); }
238};
239
241template <>
242struct TypeTraits<PDT::Colour>
243{
245 enum { hasDimension = false };
247 typedef EnumT DimType;
249 static constexpr PDT::Colour baseunit() { return PDT::Colour(3); }
250};
251
252}
253
254#endif /* ThePEG_PDT_H */
This is the main config header file for ThePEG.
PDT is a helper class implementing enumerations for charge, colour and spin to be used by the Particl...
Definition: PDT.h:24
static bool positive(Charge c)
True if the argument corresponds to a positive charge.
Definition: PDT.h:125
Charge
Definition of enumerated values used for charge information.
Definition: PDT.h:51
@ Plus1
e.
Definition: PDT.h:61
@ Minus2Third
-2e/3.
Definition: PDT.h:63
@ Minus6
-6e.
Definition: PDT.h:84
@ Plus2
2e.
Definition: PDT.h:67
@ Plus6
6e.
Definition: PDT.h:79
@ Minus8Third
-8e/3.
Definition: PDT.h:75
@ Minus2
-3e.
Definition: PDT.h:70
@ Plus5Third
5e/3.
Definition: PDT.h:66
@ Charged
Is charged.
Definition: PDT.h:54
@ Plus2Third
2e/3.
Definition: PDT.h:60
@ Minus7
-7e.
Definition: PDT.h:85
@ Minus4Third
-4e/3.
Definition: PDT.h:68
@ Plus8
8e.
Definition: PDT.h:81
@ Minus5
-5e.
Definition: PDT.h:83
@ Minus5Third
-5e/3.
Definition: PDT.h:69
@ Minus4
-4e.
Definition: PDT.h:82
@ Minus1
-e.
Definition: PDT.h:64
@ Minus1Third
-e/3.
Definition: PDT.h:62
@ Plus7Third
7e/3.
Definition: PDT.h:71
@ Plus4Third
4e/3.
Definition: PDT.h:65
@ Positive
Is positively charged.
Definition: PDT.h:55
@ Plus1Third
e/3.
Definition: PDT.h:59
@ Minus3
-3e.
Definition: PDT.h:76
@ ChargeNeutral
Uncharged.
Definition: PDT.h:57
@ ChargeUnknown
Unknown charge.
Definition: PDT.h:52
@ Plus5
5e.
Definition: PDT.h:78
@ Minus8
-8e.
Definition: PDT.h:86
@ Plus8Third
8e/3.
Definition: PDT.h:72
@ ChargeUndefined
Undefined charge.
Definition: PDT.h:53
@ Plus4
4e.
Definition: PDT.h:77
@ Minus7Third
-7e/3.
Definition: PDT.h:74
@ Plus3
3e.
Definition: PDT.h:73
@ Charge0
Uncharged.
Definition: PDT.h:58
@ Plus7
7e.
Definition: PDT.h:80
@ Negative
Is negatively charged.
Definition: PDT.h:56
Spin
Definition of enumerated values used for spin information.
Definition: PDT.h:32
@ Spin4
Spin 5.
Definition: PDT.h:44
@ Spin1Half
Spin 1/2.
Definition: PDT.h:37
@ Spin3
Spin 4.
Definition: PDT.h:42
@ Spin7Half
Spin 7/2.
Definition: PDT.h:43
@ Spin0
Spin zero.
Definition: PDT.h:36
@ SpinNA
Spin is not applicable.
Definition: PDT.h:33
@ Spin5Half
Spin 5/2.
Definition: PDT.h:41
@ Spin3Half
Spin 3/2.
Definition: PDT.h:39
@ SpinUndefined
Undefined spin.
Definition: PDT.h:35
@ Spin2
Spin 2.
Definition: PDT.h:40
@ SpinUnknown
Unknown spin.
Definition: PDT.h:34
@ Spin1
Spin 1.
Definition: PDT.h:38
static bool negative(Charge c)
True if the argument corresponds to a negative charge.
Definition: PDT.h:132
static vector< long > flavourContent(const ParticleData &)
Return the flavour content of the given particle.
Colour
Definition of enumerated values used for colour information.
Definition: PDT.h:92
@ ColourNeutral
Colour-singlet.
Definition: PDT.h:95
@ Colour3
Colour-triplet.
Definition: PDT.h:98
@ Colour8
Colour-octet.
Definition: PDT.h:102
@ Colour0
Colour-singlet.
Definition: PDT.h:96
@ Colour6bar
Colour-anti-sextet.
Definition: PDT.h:101
@ ColourUnknown
Unknown colour.
Definition: PDT.h:93
@ Colour6
Colour-sextet.
Definition: PDT.h:100
@ ColourUndefined
Undefined colour.
Definition: PDT.h:94
@ Colour3bar
Colour-anti-triplet.
Definition: PDT.h:99
@ Coloured
Coloured.
Definition: PDT.h:97
ColouredInteraction
Define type of nonabelian interactions.
Definition: PDT.h:108
static bool charged(Charge c)
True if the argument corresponds to a non-zero charge.
Definition: PDT.h:118
static Colour antiColour(Colour c)
Return the anti-colour of the specified colour.
Definition: PDT.h:146
static vector< long > flavourContent(long id)
Return the flavour content of the given particle.
static vector< long > flavourContent(const Particle &)
Return the flavour content of the given particle.
static bool coloured(Colour c)
True if the argument corresponds to a non-zero colour charge.
Definition: PDT.h:139
static vector< long > flavourContent(tcPPtr)
Return the flavour content of the given particle.
static vector< long > flavourContent(tcPDPtr)
Return the flavour content of the given particle.
ParticleData inherits from InterfacedBase and represents the properties of a particle type.
Definition: ParticleData.h:36
The Particle class is used to describe an instance of a particle.
Definition: Particle.h:83
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
vector< T > & operator>>(vector< T > &tv, U &u)
Overload the right shift operator for vector to pop objects from a vector.
Definition: Containers.h:192
Conversion between integers and types.
Definition: TemplateTools.h:24
EnumT DimType
Type switch set to standard type.
Definition: PDT.h:235
static constexpr PDT::Charge baseunit()
Base unit.
Definition: PDT.h:237
static constexpr PDT::Colour baseunit()
Base unit.
Definition: PDT.h:249
EnumT DimType
Type switch set to standard type.
Definition: PDT.h:247
static constexpr PDT::Spin baseunit()
Base unit.
Definition: PDT.h:225
EnumT DimType
Type switch set to standard type.
Definition: PDT.h:223
Type traits for built-in types.
Definition: TemplateTools.h:49