thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.5
PDT.h
1 // -*- C++ -*-
2 //
3 // PDT.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2017 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 
13 #include "ThePEG/Config/ThePEG.h"
14 
15 namespace ThePEG {
16 
24 class PDT {
25 
26 public:
27 
32  enum Spin {
33  SpinNA = -1,
36  Spin0 = 1,
37  Spin1Half = 2,
38  Spin1 = 3,
39  Spin3Half = 4,
40  Spin2 = 5,
41  Spin5Half = 6,
42  Spin3 = 7,
43  Spin7Half = 8,
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,
59  Plus1Third = 1,
60  Plus2Third = 2,
61  Plus1 = 3,
62  Minus1Third = -1,
63  Minus2Third = -2,
64  Minus1 = -3,
65  Plus4Third = 4,
66  Plus5Third = 5,
67  Plus2 = 6,
68  Minus4Third = -4,
69  Minus5Third = -5,
70  Minus2 = -6,
71  Plus7Third = 7,
72  Plus8Third = 8,
73  Plus3 = 9,
74  Minus7Third = -7,
75  Minus8Third = -8,
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,
97  Coloured = 1,
98  Colour3 = 3,
99  Colour3bar = -3,
100  Colour6 = 6,
101  Colour6bar = -6,
102  Colour8 = 8
103  };
104 
108  static bool charged(Charge c) {
109  return c != ChargeNeutral && c != ChargeUndefined;
110  }
111 
115  static bool positive(Charge c) {
116  return c > ChargeNeutral && c != Charged;
117  }
118 
122  static bool negative(Charge c) {
123  return c < ChargeNeutral && c != ChargeUndefined;
124  }
125 
129  static bool coloured(Colour c) {
130  return c != ColourNeutral && c != ColourUnknown;
131  }
132 
137  if ( c == Colour3 || c == Colour3bar ) return Colour(-c);
138  if ( c == Colour6 || c == Colour6bar ) return Colour(-c);
139  return c;
140  }
141 
147  static vector<long> flavourContent(long id);
148 
154  static vector<long> flavourContent(tcPDPtr);
155 
161  static vector<long> flavourContent(tcPPtr);
162 
168  static vector<long> flavourContent(const ParticleData &);
169 
175  static vector<long> flavourContent(const Particle &);
176 
177 };
178 
180 template <typename IStream>
181 IStream & operator>>(IStream & is, PDT::Colour & c) {
182  int ci;
183  is >> ci;
184  c = PDT::Colour(ci);
185  return is;
186 }
187 
189 template <typename IStream>
190 IStream & operator>>(IStream & is, PDT::Charge & c) {
191  int ci;
192  is >> ci;
193  c = PDT::Charge(ci);
194  return is;
195 }
196 
198 template <typename IStream>
199 IStream & operator>>(IStream & is, PDT::Spin & s) {
200  int si;
201  is >> si;
202  s = PDT::Spin(si);
203  return is;
204 }
205 
206 }
207 
208 #endif /* ThePEG_PDT_H */
Charge
Definition of enumerated values used for charge information.
Definition: PDT.h:51
Is positively charged.
Definition: PDT.h:55
The Particle class is used to describe an instance of a particle.
Definition: Particle.h:83
Colour-singlet.
Definition: PDT.h:96
Colour-sextet.
Definition: PDT.h:100
static bool coloured(Colour c)
True if the argument corresponds to a non-zero colour charge.
Definition: PDT.h:129
static bool charged(Charge c)
True if the argument corresponds to a non-zero charge.
Definition: PDT.h:108
Spin 7/2.
Definition: PDT.h:43
Colour
Definition of enumerated values used for colour information.
Definition: PDT.h:92
Spin 5/2.
Definition: PDT.h:41
Colour-anti-sextet.
Definition: PDT.h:101
PDT is a helper class implementing enumerations for charge, colour and spin to be used by the Particl...
Definition: PDT.h:24
Spin zero.
Definition: PDT.h:36
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
Is charged.
Definition: PDT.h:54
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
Spin is not applicable.
Definition: PDT.h:33
Colour-triplet.
Definition: PDT.h:98
This is the main config header file for ThePEG.
Colour-singlet.
Definition: PDT.h:95
Uncharged.
Definition: PDT.h:58
Colour-octet.
Definition: PDT.h:102
ParticleData inherits from InterfacedBase and represents the properties of a particle type...
Definition: ParticleData.h:36
Unknown spin.
Definition: PDT.h:34
Undefined charge.
Definition: PDT.h:53
Spin 3/2.
Definition: PDT.h:39
Spin
Definition of enumerated values used for spin information.
Definition: PDT.h:32
Spin 1.
Definition: PDT.h:38
Uncharged.
Definition: PDT.h:57
static vector< long > flavourContent(long id)
Return the flavour content of the given particle.
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
static bool negative(Charge c)
True if the argument corresponds to a negative charge.
Definition: PDT.h:122
Unknown colour.
Definition: PDT.h:93
Colour-anti-triplet.
Definition: PDT.h:99
Is negatively charged.
Definition: PDT.h:56
static bool positive(Charge c)
True if the argument corresponds to a positive charge.
Definition: PDT.h:115
Spin 1/2.
Definition: PDT.h:37
Coloured.
Definition: PDT.h:97
Undefined spin.
Definition: PDT.h:35
Spin 4.
Definition: PDT.h:42
static Colour antiColour(Colour c)
Return the anti-colour of the specified colour.
Definition: PDT.h:136
Spin 2.
Definition: PDT.h:40
Spin 5.
Definition: PDT.h:44
Unknown charge.
Definition: PDT.h:52
Undefined colour.
Definition: PDT.h:94