thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
Matcher.h
1// -*- C++ -*-
2//
3// Matcher.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 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
15namespace ThePEG {
16
26template <class T>
27class Matcher: public MatcherBase {
28
29public:
30
36 virtual ~Matcher();
38
44 static PMPtr Create(const string & newName, string antiName);
48 virtual PMPtr pmclone() const;
50
51
52protected:
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
86protected:
87
91 static void setCC(tPMPtr pm, tPMPtr apm) { MatcherBase::setCC(pm,apm); }
92
93private:
94
100
101};
102
107struct MatcherType {};
108
113template <typename T>
114struct BaseClassTrait<Matcher<T>,1>: public ClassTraitsType {
116 typedef MatcherBase NthBase;
117};
118
122template <typename T>
123struct 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 */
MatcherBase is an abstract base class to be used for objects representing groups of ParticleData obje...
Definition: MatcherBase.h:29
static void setCC(tPMPtr pm, tPMPtr apm)
Set antipartner.
Definition: MatcherBase.h:309
Matcher is a templated class inheriting from MatcherBase.
Definition: Matcher.h:27
static PMPtr Create(const string &newName, string antiName)
Create and clone Matcher objects.
virtual IBPtr clone() const
Make a simple clone of this object.
virtual PMPtr pmclone() const
Create and clone Matcher objects.
static bool Check(const ParticleData &pd)
Static check function.
Definition: Matcher.h:83
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: Matcher.h:91
virtual ~Matcher()
Destructor.
static NoPIOClassDescription< Matcher< T > > initMatcher
The static object used to initialize the description of this class.
Definition: Matcher.h:99
virtual bool check(const ParticleData &pd) const
Virtual function overriding the one in MatcherBase.
Definition: Matcher.h:76
A concreate implementation of ClassDescriptionBase describing a concrete class without persistent dat...
ParticleData inherits from InterfacedBase and represents the properties of a particle type.
Definition: ParticleData.h:36
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
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
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
MatcherType is an empty non-polymorphic base class for all matcher classes to be used as template arg...
Definition: Matcher.h:107