File indexing completed on 2026-08-06 09:24:21
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef Herwig_StandardMatchers_H
0010 #define Herwig_StandardMatchers_H
0011
0012
0013
0014 #include "ThePEG/PDT/Matcher.h"
0015 #include "ThePEG/Repository/CurrentGenerator.h"
0016 #include "ThePEG/PDF/BeamParticleData.h"
0017 #include "ThePEG/PDT/EnumParticles.h"
0018
0019 namespace Herwig {
0020 using namespace ThePEG;
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 struct PhotonMatcher: public MatcherType {
0038
0039 typedef PhotonMatcher CC;
0040
0041
0042 static bool Check(const ParticleData & pd) {
0043 return pd.id()==ParticleID::gamma;
0044 }
0045
0046 static string className() { return "Photon"; }
0047 };
0048
0049
0050
0051
0052 typedef Matcher<PhotonMatcher> MatchPhoton;
0053
0054
0055
0056
0057 struct TopMatcher: public MatcherType {
0058
0059 typedef TopMatcher CC;
0060
0061
0062 static bool Check(const ParticleData & pd) {
0063 return abs(pd.id())==ParticleID::t;
0064 }
0065
0066 static string className() { return "Top"; }
0067 };
0068
0069
0070
0071
0072 typedef Matcher<TopMatcher> MatchTop;
0073
0074
0075
0076
0077 struct BottomMatcher: public MatcherType {
0078
0079 typedef BottomMatcher CC;
0080
0081
0082 static bool Check(const ParticleData & pd) {
0083 return abs(pd.id())==ParticleID::b;
0084 }
0085
0086 static string className() { return "Bottom"; }
0087 };
0088
0089
0090
0091
0092 typedef Matcher<BottomMatcher> MatchBottom;
0093
0094
0095
0096
0097 struct HadronMatcher: public MatcherType {
0098
0099 typedef HadronMatcher CC;
0100
0101
0102 static bool Check(const ParticleData & pd) {
0103 if (pd.id() != ParticleID::gamma) return Check(pd.id());
0104 else {
0105 Ptr<BeamParticleData>::const_pointer beam =
0106 dynamic_ptr_cast< Ptr<BeamParticleData>::const_pointer>(&pd);
0107 return beam && beam->pdf();
0108 }
0109 }
0110
0111
0112 static bool Check(long id) {
0113 bool hadron = (id/10)%10 && (id/100)%10;
0114 if(hadron) return true;
0115
0116 if (id != ParticleID::gamma) return false;
0117 tcPDPtr gamma = CurrentGenerator::current().getParticleData(ParticleID::gamma);
0118 Ptr<BeamParticleData>::const_pointer beam =
0119 dynamic_ptr_cast< Ptr<BeamParticleData>::const_pointer>(gamma);
0120 return beam && beam->pdf();
0121 }
0122
0123 static string className() { return "Hadron"; }
0124 };
0125
0126 typedef Matcher<HadronMatcher> MatchHadron;
0127
0128
0129
0130
0131 struct WBosonMatcher: public MatcherType {
0132
0133 typedef WBosonMatcher CC;
0134
0135
0136 static bool Check(const ParticleData & pd) {
0137 return abs(pd.id())==ParticleID::Wplus;
0138 }
0139
0140 static string className() { return "WBoson"; }
0141 };
0142
0143
0144
0145
0146 typedef Matcher<WBosonMatcher> MatchWBoson;
0147
0148
0149
0150
0151 struct ZBosonMatcher: public MatcherType {
0152
0153 typedef ZBosonMatcher CC;
0154
0155
0156 static bool Check(const ParticleData & pd) {
0157 return abs(pd.id())==ParticleID::Z0;
0158 }
0159
0160 static string className() { return "ZBoson"; }
0161 };
0162
0163
0164
0165
0166 typedef Matcher<ZBosonMatcher> MatchZBoson;
0167
0168
0169
0170
0171 struct HiggsBosonMatcher: public MatcherType {
0172
0173 typedef HiggsBosonMatcher CC;
0174
0175
0176 static bool Check(const ParticleData & pd) {
0177 return abs(pd.id())==ParticleID::h0;
0178 }
0179
0180 static string className() { return "HiggsBoson"; }
0181 };
0182
0183
0184
0185
0186 typedef Matcher<HiggsBosonMatcher> MatchHiggsBoson;
0187
0188
0189
0190
0191 struct ChargedLeptonMatcher: public MatcherType {
0192
0193 typedef ChargedLeptonMatcher CC;
0194
0195
0196 static bool Check(const ParticleData & pd) {
0197 return Check(pd.id());
0198 }
0199 static bool Check(long id) {
0200 return abs(id) > 10 && abs(id) <= 20 && abs(id)%2!=0;
0201 }
0202
0203
0204 static string className() { return "ChargedLepton"; }
0205 };
0206
0207 typedef Matcher<ChargedLeptonMatcher> MatchChargedLepton;
0208
0209
0210
0211
0212 struct LightParticleMatcher: public MatcherType {
0213
0214 typedef LightParticleMatcher CC;
0215
0216
0217 static bool Check(const ParticleData & pd) {
0218 return pd.id()!=22 && abs(pd.id()) > 6 && abs(pd.id())!=11 &&
0219 abs(pd.id())!=13 && abs(pd.id())!=15 && abs(pd.mass())<=GeV;
0220 }
0221
0222 static string className() { return "LightParticle"; }
0223 };
0224
0225
0226
0227
0228 typedef Matcher<LightParticleMatcher> MatchLightParticle;
0229
0230 }
0231 #endif