thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.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-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
17namespace ThePEG {
18
37struct 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
60 static bool Check(const ParticleData & pd) {
61 return PDT::charged(pd.iCharge());
62 }
64 static string className() { return "Charged"; }
65};
68
69struct NegativeMatcher;
70
79 static bool Check(const ParticleData & pd) {
80 return PDT::positive(pd.iCharge());
81 }
83 static string className() { return "Positive"; }
84};
87
88
97 static bool Check(const ParticleData & pd) {
98 return pd.iCharge() == PDT::Charge0;
99 }
101 static string className() { return "Neutral"; }
102};
105
114 static bool Check(const ParticleData & pd) {
115 return PDT::negative(pd.iCharge());
116 }
118 static string className() { return "Negative"; }
119};
122
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
147struct MesonMatcher: public MatcherType {
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
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
188struct QuarkMatcher: public MatcherType {
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
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
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
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 */
Matcher is a templated class inheriting from MatcherBase.
Definition: Matcher.h:27
static bool positive(Charge c)
True if the argument corresponds to a positive charge.
Definition: PDT.h:125
@ Charge0
Uncharged.
Definition: PDT.h:58
static bool negative(Charge c)
True if the argument corresponds to a negative charge.
Definition: PDT.h:132
static bool charged(Charge c)
True if the argument corresponds to a non-zero charge.
Definition: PDT.h:118
ParticleData inherits from InterfacedBase and represents the properties of a particle type.
Definition: ParticleData.h:36
long id() const
Return the PDG id number.
Definition: ParticleData.h:80
PDT::Charge iCharge(PDT::Charge)
Set the charge.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
Matcher< LightQuarkMatcher > MatchLightQuark
Gives a MatcherBase class based on LightQuarkMatcher.
Matcher< LightAntiQuarkMatcher > MatchLightAntiQuark
Gives a MatcherBase class based on LightAntiQuarkMatcher.
Matcher< QuarkMatcher > MatchQuark
Gives a MatcherBase class based on QuarkMatcher.
Matcher< StandardQCDPartonMatcher > MatchStandardQCDParton
Gives a MatcherBase class based on StandardQCDPartonMatcher.
Matcher< BaryonMatcher > MatchBaryon
Gives a MatcherBase class based on BaryonMatcher.
Matcher< PositiveMatcher > MatchPositive
Gives a MatcherBase class based on PositiveMatcher.
Matcher< DiquarkMatcher > MatchDiquark
Gives a MatcherBase class based on DiquarkMatcher.
Matcher< VectorMesonMatcher > MatchVectorMeson
Gives a MatcherBase class based on VectorMesonMatcher.
Matcher< ChargedMatcher > MatchCharged
Gives a MatcherBase class based on ChargedMatcher.
Matcher< AnyMatcher > MatchAny
Gives a MatcherBase class based on AnyMatcher.
Matcher< NeutrinoMatcher > MatchNeutrino
Gives a MatcherBase class based on VectorMesonMatcher.
Matcher< MesonMatcher > MatchMeson
Gives a MatcherBase class based on MesonMatcher.
Matcher< PseudoScalarMesonMatcher > MatchPseudoScalarMeson
Gives a MatcherBase class based on PseudoScalarMesonMatcher.
Matcher< LeptonMatcher > MatchLepton
Gives a MatcherBase class based on LeptonMatcher.
Matcher< NeutralMatcher > MatchNeutral
Gives a MatcherBase class based on NeutralMatcher.
Matcher< NegativeMatcher > MatchNegative
Gives a MatcherBase class based on NegativeMatcher.
A Matcher class which matches any particle.
static string className()
A simplified but unique class name.
AnyMatcher 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.
A Matcher class which matches any baryon.
BaryonMatcher CC
Typedef the class matching the complex conjugate particles.
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 string className()
A simplified but unique class name.
A Matcher class which matches any charged particle.
ChargedMatcher 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.
static string className()
A simplified but unique class name.
A Matcher class which matches any (anti-)diquark.
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 string className()
A simplified but unique class name.
DiquarkMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any lepton.
LeptonMatcher 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.
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.
A Matcher class which matches any light anti-quark ( , or ).
LightQuarkMatcher CC
Typedef the class matching the complex conjugate particles.
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(long id)
The main static function to check if a given particle with type id matches.
A Matcher class which matches any light quark (d,u or s).
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.
LightAntiQuarkMatcher CC
Typedef the class matching the complex conjugate particles.
static string className()
A simplified but unique class name.
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 meson.
MesonMatcher CC
Typedef the class matching the complex conjugate particles.
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(long id)
The main static function to check if a given particle with type id matches.
A Matcher class which matches any negatively charged particle.
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.
PositiveMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any uncharged particle.
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.
NeutralMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any neutrino.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
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.
NeutrinoMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any positively charged particle.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
static string className()
A simplified but unique class name.
NegativeMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any pseudo scalar meson.
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.
PseudoScalarMesonMatcher CC
Typedef the class matching the complex conjugate particles.
static string className()
A simplified but unique class name.
A Matcher class which matches any (anti-)quark.
static bool Check(long id)
The main static function to check if a given particle with type id matches.
QuarkMatcher 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.
static string className()
A simplified but unique class name.
A Matcher class which matches any standard QCD parton, ie.
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(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.
A Matcher class which matches any vector meson.
VectorMesonMatcher CC
Typedef the class matching the complex conjugate particles.
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 string className()
A simplified but unique class name.