herwig is hosted by Hepforge, IPPP Durham
Herwig  7.1.5
StandardMatchers.h
1 // -*- C++ -*-
2 //
3 // StandardMatchers.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2017 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 
19 namespace Herwig {
20 using namespace ThePEG;
21 
37 struct PhotonMatcher: public MatcherType {
39  typedef PhotonMatcher CC;
42  static bool Check(const ParticleData & pd) {
43  return pd.id()==ParticleID::gamma;
44  }
46  static string className() { return "Photon"; }
47 };
48 
53 
57 struct 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 
77 struct BottomMatcher: public MatcherType {
79  typedef BottomMatcher CC;
82  static bool Check(const ParticleData & pd) {
83  return abs(pd.id())==ParticleID::b;
84  }
86  static string className() { return "Bottom"; }
87 };
88 
93 
97 struct HadronMatcher: public MatcherType {
99  typedef HadronMatcher CC;
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;
117  tcPDPtr gamma = CurrentGenerator::current().getParticleData(ParticleID::gamma);
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 
131 struct WBosonMatcher: public MatcherType {
133  typedef WBosonMatcher CC;
136  static bool Check(const ParticleData & pd) {
137  return abs(pd.id())==ParticleID::Wplus;
138  }
140  static string className() { return "WBoson"; }
141 };
142 
147 
151 struct ZBosonMatcher: public MatcherType {
153  typedef ZBosonMatcher CC;
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 }
209 
210 #endif /* Herwig_StandardMatchers_H */
Matcher< PhotonMatcher > MatchPhoton
Gives a MatcherBase class based on PhotonMatcher.
static string className()
A simplified but unique class name.
A Matcher class which matches any charged lepton.
A Matcher class which matches Higgs bosons.
HadronMatcher 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.
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.
static string className()
A simplified but unique class name.
Matcher< ZBosonMatcher > MatchZBoson
Gives a MatcherBase class based on ZBosonMatcher.
static string className()
A simplified but unique class name.
ChargedLeptonMatcher 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.
Matcher< HiggsBosonMatcher > MatchHiggsBoson
Gives a MatcherBase class based on HiggsBosonMatcher.
A Matcher class which matches W bosons.
A Matcher class which matches any hadron.
static string className()
A simplified but unique class name.
A Matcher class which matches Z bosons.
static string className()
A simplified but unique class name.
PDPtr getParticleData(PID id) const
Matcher< HadronMatcher > MatchHadron
Gives a MatcherBase class based on HadronMatcher.
Matcher< TopMatcher > MatchTop
Gives a MatcherBase class based on TopMatcher.
HiggsBosonMatcher CC
Typedef the class matching the complex conjugate particles.
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
PhotonMatcher CC
Typedef the class matching the complex conjugate particles.
WBosonMatcher CC
Typedef the class matching the complex conjugate particles.
ZBosonMatcher 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 EventGenerator & current()
static bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
A Matcher class which matches bottom quarks.
static string className()
A simplified but unique class name.
Matcher< ChargedLeptonMatcher > MatchChargedLepton
Gives a MatcherBase class based on ChargedLeptonMatcher.
A Matcher class which matches top quarks.
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.
-*- C++ -*-
BottomMatcher 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 bool Check(const ParticleData &pd)
The main static function to check if a given particle type pd matches.
TopMatcher CC
Typedef the class matching the complex conjugate particles.
static string className()
A simplified but unique class name.
Matcher< BottomMatcher > MatchBottom
Gives a MatcherBase class based on BottomMatcher.
Matcher< WBosonMatcher > MatchWBoson
Gives a MatcherBase class based on WBosonMatcher.