Rivet  1.8.3
ParticleIdUtils.hh
1 // ----------------------------------------------------------------------
2 //
3 // ParticleIDMethods.hh
4 // Author: Lynn Garren, Andy Buckley
5 //
6 // various utilities to extract information from the particle ID
7 //
8 // In the standard numbering scheme, the PID digits (base 10) are:
9 // +/- n nr nl nq1 nq2 nq3 nj
10 // It is expected that any 7 digit number used as a PID will adhere to
11 // the Monte Carlo numbering scheme documented by the PDG.
12 // Note that many "new" particles not explicitly defined already
13 // can be expressed within this numbering scheme.
14 //
15 // These are the same methods that can be found in HepPDT::ParticleID
16 // ----------------------------------------------------------------------
17 #ifndef RIVET_PARTICLE_ID_METHODS_HH
18 #define RIVET_PARTICLE_ID_METHODS_HH
19 
20 #include "Rivet/Particle.hh"
21 
22 
23 namespace Rivet {
24 
25  namespace PID {
26 
27 
29 
30 
31  // /// if this is a nucleus (ion), get A
32  // /// Ion numbers are +/- 10LZZZAAAI.
33  // int A(const int & pid );
34 
35  // /// if this is a nucleus (ion), get Z
36  // /// Ion numbers are +/- 10LZZZAAAI.
37  // int Z(const int & pid );
38 
39  // /// if this is a nucleus (ion), get nLambda
40  // /// Ion numbers are +/- 10LZZZAAAI.
41  // int lambda( const int & pid );
42 
44  int abspid( const int & pid );
45 
46 
48  bool isValid( const int & pid );
50  bool isMeson( const int & pid );
52  bool isBaryon( const int & pid );
54  bool isDiQuark( const int & pid );
56  bool isHadron( const int & pid );
58  bool isLepton( const int & pid );
60  bool isNucleus( const int & pid );
62  bool isPentaquark( const int & pid );
64  bool isSUSY( const int & pid );
66  bool isRhadron( const int & pid );
67 
69  bool hasUp( const int & pid );
71  bool hasDown( const int & pid );
73  bool hasStrange( const int & pid );
75  bool hasCharm( const int & pid );
77  bool hasBottom( const int & pid );
79  bool hasTop( const int & pid );
80 
82  int jSpin( const int & pid );
84  int sSpin( const int & pid );
86  int lSpin( const int & pid );
87 
89  int threeCharge( const int & pid );
91  inline double charge( const int & pid ) { return threeCharge(pid)/3.0; }
92 
94 
95 
97 
98 
99 
101 
102 
105  // int A(const Particle& p) { return A(p.pdgId()); }
106 
109  // int Z(const Particle& p) { return Z(p.pdgId()); }
110 
113  // int lambda( const Particle& p) { return lambda(p.pdgId()); }
114 
116  inline int abspid( const Particle& p) { return abspid(p.pdgId()); }
117 
119  inline bool isMeson( const Particle& p ) { return isMeson(p.pdgId()); }
121  inline bool isBaryon( const Particle& p ) { return isBaryon(p.pdgId()); }
123  inline bool isDiQuark( const Particle& p ) { return isDiQuark(p.pdgId()); }
125  inline bool isHadron( const Particle& p ) { return isHadron(p.pdgId()); }
127  inline bool isLepton( const Particle& p ) { return isLepton(p.pdgId()); }
129  inline bool isNucleus( const Particle& p ) { return isNucleus(p.pdgId()); }
131  inline bool isPentaquark( const Particle& p ) { return isPentaquark(p.pdgId()); }
133  inline bool isSUSY( const Particle& p ) { return isSUSY(p.pdgId()); }
135  inline bool isRhadron( const Particle& p ) { return isRhadron(p.pdgId()); }
136 
138  inline bool hasUp( const Particle& p ) { return hasUp(p.pdgId()); }
140  inline bool hasDown( const Particle& p ) { return hasDown(p.pdgId()); }
142  inline bool hasStrange( const Particle& p ) { return hasStrange(p.pdgId()); }
144  inline bool hasCharm( const Particle& p ) { return hasCharm(p.pdgId()); }
146  inline bool hasBottom( const Particle& p ) { return hasBottom(p.pdgId()); }
148  inline bool hasTop( const Particle& p ) { return hasTop(p.pdgId()); }
149 
151  inline int jSpin( const Particle& p ) { return jSpin(p.pdgId()); }
153  inline int sSpin( const Particle& p ) { return sSpin(p.pdgId()); }
155  inline int lSpin( const Particle& p ) { return lSpin(p.pdgId()); }
156 
158  inline int threeCharge( const Particle& p ) { return threeCharge(p.pdgId()); }
160  inline double charge( const Particle& p ) { return threeCharge(p)/3.0; }
161 
163 
164  }
165 
166 }
167 
168 #endif