ThePEG  1.8.0
CombinedMatcher.h
1 // -*- C++ -*-
2 //
3 // CombinedMatcher.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_CombinedMatcher_H
10 #define ThePEG_CombinedMatcher_H
11 // This is the declaration of the AndMatcher, OrMatcher and NotMatcher.
12 
13 
14 #include "Matcher.h"
15 
16 namespace ThePEG {
17 
24 template <class T1, class T2>
25 struct AndMatcher: public MatcherType {
26 
32 
37  static bool Check(const ParticleData & pd) {
38  return T1::Check(pd) && T2::Check(pd);
39  }
40 
41 };
42 
49 template <class T1, class T2>
50 struct OrMatcher: public MatcherType {
51 
57 
62  static bool Check(const ParticleData & pd) {
63  return T1::Check(pd) || T2::Check(pd);
64  }
65 
66 };
67 
74 template <class T>
75 struct NotMatcher: public MatcherType {
76 
82 
88  static bool Check(const ParticleData & pd) {
89  return !T::Check(pd);
90  }
91 
92 };
93 
94 }
95 
96 #endif /* ThePEG_CombinedMatcher_H */