herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
StandardMatchers.h
1// -*- C++ -*-
2//
3// StandardMatchers.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4// Copyright (C) 2002-2019 The Herwig Collaboration
5//
6// Herwig 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 Herwig_StandardMatchers_H
10#define Herwig_StandardMatchers_H
11// This is the declaration of the AnyMatcher,
12
13
14#include "ThePEG/PDT/Matcher.h"
15#include "ThePEG/Repository/CurrentGenerator.h"
16#include "ThePEG/PDF/BeamParticleData.h"
17#include "ThePEG/PDT/EnumParticles.h"
18
19namespace Herwig {
20using namespace ThePEG;
21
37struct PhotonMatcher: public MatcherType {
42 static bool Check(const ParticleData & pd) {
43 return pd.id()==ParticleID::gamma;
44 }
46 static string className() { return "Photon"; }
47};
48
53
57struct TopMatcher: public MatcherType {
59 typedef TopMatcher CC;
62 static bool Check(const ParticleData & pd) {
63 return abs(pd.id())==ParticleID::t;
64 }
66 static string className() { return "Top"; }
67};
68
73
77struct BottomMatcher: public MatcherType {
82 static bool Check(const ParticleData & pd) {
83 return abs(pd.id())==ParticleID::b;
84 }
86 static string className() { return "Bottom"; }
87};
88
93
97struct HadronMatcher: public MatcherType {
102 static bool Check(const ParticleData & pd) {
103 if (pd.id() != ParticleID::gamma) return Check(pd.id());
104 else {
105 Ptr<BeamParticleData>::const_pointer beam =
106 dynamic_ptr_cast< Ptr<BeamParticleData>::const_pointer>(&pd);
107 return beam && beam->pdf();
108 }
109 }
112 static bool Check(long id) {
113 bool hadron = (id/10)%10 && (id/100)%10;
114 if(hadron) return true;
115 // special for gamma when acting like a hadron
116 if (id != ParticleID::gamma) return false;
118 Ptr<BeamParticleData>::const_pointer beam =
119 dynamic_ptr_cast< Ptr<BeamParticleData>::const_pointer>(gamma);
120 return beam && beam->pdf();
121 }
123 static string className() { return "Hadron"; }
124};
127
136 static bool Check(const ParticleData & pd) {
137 return abs(pd.id())==ParticleID::Wplus;
138 }
140 static string className() { return "WBoson"; }
141};
142
147
156 static bool Check(const ParticleData & pd) {
157 return abs(pd.id())==ParticleID::Z0;
158 }
160 static string className() { return "ZBoson"; }
161};
162
167
176 static bool Check(const ParticleData & pd) {
177 return abs(pd.id())==ParticleID::h0;
178 }
180 static string className() { return "HiggsBoson"; }
181};
182
187
196 static bool Check(const ParticleData & pd) {
197 return Check(pd.id());
198 }
199 static bool Check(long id) {
200 return abs(id) > 10 && abs(id) <= 20 && abs(id)%2!=0;
201 }
202
204 static string className() { return "ChargedLepton"; }
205};
208
217 static bool Check(const ParticleData & pd) {
218 return pd.id()!=22 && abs(pd.id()) > 6 && abs(pd.id())!=11 &&
219 abs(pd.id())!=13 && abs(pd.id())!=15 && abs(pd.mass())<=GeV;
220 }
222 static string className() { return "LightParticle"; }
223};
224
229
230}
231#endif /* Herwig_StandardMatchers_H */
static EventGenerator & current()
PDPtr getParticleData(PID id) const
Energy mass(Energy)
-*- C++ -*-
Matcher< LightParticleMatcher > MatchLightParticle
Gives a MatcherBase class based on LightParticleatcher.
Matcher< ZBosonMatcher > MatchZBoson
Gives a MatcherBase class based on ZBosonMatcher.
Matcher< BottomMatcher > MatchBottom
Gives a MatcherBase class based on BottomMatcher.
Matcher< WBosonMatcher > MatchWBoson
Gives a MatcherBase class based on WBosonMatcher.
Matcher< ChargedLeptonMatcher > MatchChargedLepton
Gives a MatcherBase class based on ChargedLeptonMatcher.
Matcher< TopMatcher > MatchTop
Gives a MatcherBase class based on TopMatcher.
Matcher< HadronMatcher > MatchHadron
Gives a MatcherBase class based on HadronMatcher.
Matcher< HiggsBosonMatcher > MatchHiggsBoson
Gives a MatcherBase class based on HiggsBosonMatcher.
Matcher< PhotonMatcher > MatchPhoton
Gives a MatcherBase class based on PhotonMatcher.
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
A Matcher class which matches bottom quarks.
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.
BottomMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any charged lepton.
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.
ChargedLeptonMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches any hadron.
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.
HadronMatcher 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.
A Matcher class which matches Higgs bosons.
HiggsBosonMatcher 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.
A Matcher class which matches any light (<1GeV) particles other than the photon.
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
LightParticleMatcher CC
Typedef the class matching the complex conjugate particles.
static string className()
A simplified but unique class name.
This file declare a set of standard matcher classes in addition to those defined in ThePEG.
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.
PhotonMatcher CC
Typedef the class matching the complex conjugate particles.
A Matcher class which matches top quarks.
TopMatcher 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 W bosons.
WBosonMatcher 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.
A Matcher class which matches Z bosons.
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.
ZBosonMatcher CC
Typedef the class matching the complex conjugate particles.