ThePEG  1.8.0
StandardMatchers.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // StandardMatchers.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_StandardMatchers_H
10 #define ThePEG_StandardMatchers_H
11 // This is the declaration of the AnyMatcher,
12 
13 
14 #include "Matcher.h"
15 #include "ThePEG/PDT/EnumParticles.h"
16 
17 namespace ThePEG {
18 
37 struct AnyMatcher: public MatcherType {
39  typedef AnyMatcher CC;
42  static bool Check(const ParticleData & pd) {
43  return bool(pd.id());
44  }
46  static string className() { return "Any"; }
47 };
50 
51 
55 struct ChargedMatcher: public MatcherType {
57  typedef ChargedMatcher CC;
60  static bool Check(const ParticleData & pd) {
61  return PDT::charged(pd.iCharge());
62  }
64  static string className() { return "Charged"; }
65 };
68 
69 struct NegativeMatcher;
70 
74 struct PositiveMatcher: public MatcherType {
79  static bool Check(const ParticleData & pd) {
80  return PDT::positive(pd.iCharge());
81  }
83  static string className() { return "Positive"; }
84 };
87 
88 
92 struct NeutralMatcher: public MatcherType {
94  typedef NeutralMatcher CC;
97  static bool Check(const ParticleData & pd) {
98  return pd.iCharge() == PDT::Charge0;
99  }
101  static string className() { return "Neutral"; }
102 };
105 
109 struct NegativeMatcher: public MatcherType {
114  static bool Check(const ParticleData & pd) {
115  return PDT::negative(pd.iCharge());
116  }
118  static string className() { return "Negative"; }
119 };
122 
126 struct BaryonMatcher: public MatcherType {
128  typedef BaryonMatcher CC;
131  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
134  static bool Check(long id) {
135  return (id/10)%10 && (id/100)%10 && (id/1000)%10;
136  }
138  static string className() { return "Baryon"; }
139 };
142 
143 
147 struct MesonMatcher: public MatcherType {
149  typedef MesonMatcher CC;
152  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
155  static bool Check(long id) {
156  return (id/10)%10 && (id/100)%10 && (id/1000)%10 == 0;
157  }
159  static string className() { return "Meson"; }
160 };
163 
164 
168 struct DiquarkMatcher: public MatcherType {
173  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
176  static bool Check(long id) {
177  return id/10 && (id/10)%10 == 0 && (id/100)%10 && (id/1000)%10;
178  }
180  static string className() { return "Diquark"; }
181 };
184 
188 struct QuarkMatcher: public MatcherType {
190  typedef QuarkMatcher CC;
193  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
196  static bool Check(long id) {
197  return id && abs(id) < 10;
198  }
200  static string className() { return "Quark"; }
201 };
204 
208 struct LeptonMatcher: public MatcherType {
210  typedef LeptonMatcher CC;
213  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
216  static bool Check(long id) {
217  return abs(id) > 10 && abs(id) <= 20;
218  }
220  static string className() { return "Lepton"; }
221 };
224 
225 struct LightAntiQuarkMatcher;
226 
235  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
238  static bool Check(long id) {
239  return id > 0 && id < 4 ;
240  }
242  static string className() { return "LightQuark"; }
243 };
246 
247 
258  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
261  static bool Check(long id) {
262  return id < 0 && id > -4 ;
263  }
265  static string className() { return "LightAntiQuark"; }
266 };
269 
279  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
282  static bool Check(long id) {
283  return id && ( abs(id) <= 5 || id == ParticleID::g );
284  }
286  static string className() { return "StandardQCDParton"; }
287 };
288 
291 
300  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
303  static bool Check(long id) {
304  return ( (abs(id)/1000)%1 == 0 && abs(id) > 100 && abs(id)%10 == 1 ) ||
305  ( id == ParticleID::K_L0 || id == ParticleID::K_S0 );
306  }
308  static string className() { return "PseudoScalarMeson"; }
309 };
310 
313 
314 
323  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
326  static bool Check(long id) {
327  return (abs(id)/1000)%1 == 0 && abs(id) > 100 && abs(id)%10 == 3;
328  }
330  static string className() { return "VectorMeson"; }
331 };
332 
335 
336 }
337 
338 #endif /* ThePEG_StandardMatchers_H */