thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.5
Matcher.h
1 // -*- C++ -*-
2 //
3 // Matcher.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2017 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_Matcher_H
10 #define ThePEG_Matcher_H
11 // This is the declaration of the Matcher class.
12 
13 #include "MatcherBase.h"
14 
15 namespace ThePEG {
16 
26 template <class T>
27 class Matcher: public MatcherBase {
28 
29 public:
30 
36  virtual ~Matcher();
38 
44  static PMPtr Create(const string & newName, string antiName);
48  virtual PMPtr pmclone() const;
50 
51 
52 protected:
53 
60  virtual IBPtr clone() const;
61 
66  virtual IBPtr fullclone() const;
68 
69 
76  virtual bool check(const ParticleData & pd) const { return T::Check(pd); }
77 
83  static bool Check(const ParticleData & pd) { return T::Check(pd); }
85 
86 protected:
87 
91  static void setCC(tPMPtr pm, tPMPtr apm) { MatcherBase::setCC(pm,apm); }
92 
93 private:
94 
100 
101 };
102 
107 struct MatcherType {};
108 
113 template <typename T>
114 struct BaseClassTrait<Matcher<T>,1>: public ClassTraitsType {
116  typedef MatcherBase NthBase;
117 };
118 
122 template <typename T>
123 struct ClassTraits< Matcher<T> >: public ClassTraitsBase< Matcher<T> > {
125  static string className() {
126  return "ThePEG::Matcher<" + T::className() + ">";
127  }
128 };
129 
132 }
133 
134 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
135 #include "Matcher.tcc"
136 #endif
137 
138 #endif /* ThePEG_Matcher_H */
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
MatcherBase is an abstract base class to be used for objects representing groups of ParticleData obje...
Definition: MatcherBase.h:29
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
A concreate implementation of ClassDescriptionBase describing a concrete class without persistent dat...
virtual bool check(const ParticleData &pd) const
Virtual function overriding the one in MatcherBase.
Definition: Matcher.h:76
ParticleData inherits from InterfacedBase and represents the properties of a particle type...
Definition: ParticleData.h:36
virtual PMPtr pmclone() const
Create and clone Matcher objects.
MatcherType is an empty non-polymorphic base class for all matcher classes to be used as template arg...
Definition: Matcher.h:107
static void setCC(tPMPtr pm, tPMPtr apm)
Set antipartner.
Definition: Matcher.h:91
Matcher is a templated class inheriting from MatcherBase.
Definition: Matcher.h:27
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
virtual ~Matcher()
Destructor.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
static void setCC(tPMPtr pm, tPMPtr apm)
Set antipartner.
Definition: MatcherBase.h:314
virtual IBPtr clone() const
Make a simple clone of this object.
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
static bool Check(const ParticleData &pd)
Static check function.
Definition: Matcher.h:83
static NoPIOClassDescription< Matcher< T > > initMatcher
The static object used to initialize the description of this class.
Definition: Matcher.h:99
static PMPtr Create(const string &newName, string antiName)
Create and clone Matcher objects.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52