thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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-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_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 
228 struct NeutrinoMatcher: public MatcherType {
233  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
236  static bool Check(long id) {
237  return abs(id)-10 >= 2 && abs(id)-10 <= 8 && abs(id)%2 == 0;
238  }
240  static string className() { return "Neutrino"; }
241 };
242 
245 
246 struct LightAntiQuarkMatcher;
247 
256  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
259  static bool Check(long id) {
260  return id > 0 && id < 4 ;
261  }
263  static string className() { return "LightQuark"; }
264 };
267 
268 
279  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
282  static bool Check(long id) {
283  return id < 0 && id > -4 ;
284  }
286  static string className() { return "LightAntiQuark"; }
287 };
290 
300  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
303  static bool Check(long id) {
304  return id && ( abs(id) <= 5 || id == ParticleID::g );
305  }
307  static string className() { return "StandardQCDParton"; }
308 };
309 
312 
321  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
324  static bool Check(long id) {
325  return ( (abs(id)/1000)%1 == 0 && abs(id) > 100 && abs(id)%10 == 1 ) ||
326  ( id == ParticleID::K_L0 || id == ParticleID::K_S0 );
327  }
329  static string className() { return "PseudoScalarMeson"; }
330 };
331 
334 
335 
344  static bool Check(const ParticleData & pd) { return Check(pd.id()); }
347  static bool Check(long id) {
348  return (abs(id)/1000)%1 == 0 && abs(id) > 100 && abs(id)%10 == 3;
349  }
351  static string className() { return "VectorMeson"; }
352 };
353 
356 
357 }
358 
359 #endif /* ThePEG_StandardMatchers_H */
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
A Matcher class which matches any charged particle.
static string className()
A simplified but unique class name.
static string className()
A simplified but unique class name.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
A Matcher class which matches any pseudo scalar meson.
NeutrinoMatcher CC
Typedef the class matching the complex conjugate particles.
Matcher< BaryonMatcher > MatchBaryon
Gives a MatcherBase class based on BaryonMatcher.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
Matcher< NegativeMatcher > MatchNegative
Gives a MatcherBase class based on NegativeMatcher.
static string className()
A simplified but unique class name.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
static bool charged(Charge c)
True if the argument corresponds to a non-zero charge.
Definition: PDT.h:108
static bool Check(long id)
The main static function to check if a given particle with type id matches.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
Matcher< StandardQCDPartonMatcher > MatchStandardQCDParton
Gives a MatcherBase class based on StandardQCDPartonMatcher.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
A Matcher class which matches any light quark (d,u or s).
static bool Check(long id)
The main static function to check if a given particle with type id matches.
DiquarkMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any particle.
static string className()
A simplified but unique class name.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
static string className()
A simplified but unique class name.
Matcher< LightQuarkMatcher > MatchLightQuark
Gives a MatcherBase class based on LightQuarkMatcher.
static string className()
A simplified but unique class name.
LightAntiQuarkMatcher CC
Typedef the class matching the complex conjugate particles.
Matcher< LeptonMatcher > MatchLepton
Gives a MatcherBase class based on LeptonMatcher.
NeutralMatcher CC
Typedef the class matching the complex conjugate particles.
Uncharged.
Definition: PDT.h:58
QuarkMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any neutrino.
ParticleData inherits from InterfacedBase and represents the properties of a particle type...
Definition: ParticleData.h:36
static bool Check(long id)
The main static function to check if a given particle with type id matches.
PositiveMatcher CC
Typedef the class matching the complex conjugate particles.
Matcher< MesonMatcher > MatchMeson
Gives a MatcherBase class based on MesonMatcher.
Matcher< QuarkMatcher > MatchQuark
Gives a MatcherBase class based on QuarkMatcher.
NegativeMatcher CC
Typedef the class matching the complex conjugate particles.
MatcherType is an empty non-polymorphic base class for all matcher classes to be used as template arg...
Definition: Matcher.h:107
A Matcher class which matches any lepton.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
MesonMatcher CC
Typedef the class matching the complex conjugate particles.
static string className()
A simplified but unique class name.
BaryonMatcher CC
Typedef the class matching the complex conjugate particles.
Matcher is a templated class inheriting from MatcherBase.
Definition: Matcher.h:27
A Matcher class which matches any (anti-)quark.
LightQuarkMatcher CC
Typedef the class matching the complex conjugate particles.
PDT::Charge iCharge(PDT::Charge)
Set the charge.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
LeptonMatcher CC
Typedef the class matching the complex conjugate particles.
static string className()
A simplified but unique class name.
Matcher< LightAntiQuarkMatcher > MatchLightAntiQuark
Gives a MatcherBase class based on LightAntiQuarkMatcher.
A Matcher class which matches any positively charged particle.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
StandardQCDPartonMatcher CC
Typedef the class matching the complex conjugate particles.
Matcher< NeutralMatcher > MatchNeutral
Gives a MatcherBase class based on NeutralMatcher.
A Matcher class which matches any negatively charged particle.
A Matcher class which matches any meson.
static bool negative(Charge c)
True if the argument corresponds to a negative charge.
Definition: PDT.h:122
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
A Matcher class which matches any uncharged particle.
VectorMesonMatcher CC
Typedef the class matching the complex conjugate particles.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
AnyMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any standard QCD parton, ie.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
Matcher< DiquarkMatcher > MatchDiquark
Gives a MatcherBase class based on DiquarkMatcher.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
static bool positive(Charge c)
True if the argument corresponds to a positive charge.
Definition: PDT.h:115
A Matcher class which matches any light anti-quark ( , or ).
static string className()
A simplified but unique class name.
static string className()
A simplified but unique class name.
A Matcher class which matches any baryon.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
Matcher< VectorMesonMatcher > MatchVectorMeson
Gives a MatcherBase class based on VectorMesonMatcher.
static string className()
A simplified but unique class name.
A Matcher class which matches any vector meson.
static string className()
A simplified but unique class name.
static string className()
A simplified but unique class name.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
ChargedMatcher CC
Typedef the class matching the complex conjugate particles.
Matcher< AnyMatcher > MatchAny
Gives a MatcherBase class based on AnyMatcher.
static string className()
A simplified but unique class name.
static string className()
A simplified but unique class name.
long id() const
Return the PDG id number.
Definition: ParticleData.h:88
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
Matcher< PositiveMatcher > MatchPositive
Gives a MatcherBase class based on PositiveMatcher.
Matcher< PseudoScalarMesonMatcher > MatchPseudoScalarMeson
Gives a MatcherBase class based on PseudoScalarMesonMatcher.
static string className()
A simplified but unique class name.
Matcher< ChargedMatcher > MatchCharged
Gives a MatcherBase class based on ChargedMatcher.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
PseudoScalarMesonMatcher CC
Typedef the class matching the complex conjugate particles.
Matcher< NeutrinoMatcher > MatchNeutrino
Gives a MatcherBase class based on VectorMesonMatcher.
A Matcher class which matches any (anti-)diquark.