thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.5
FlavourGenerator.h
1 // -*- C++ -*-
2 //
3 // FlavourGenerator.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_FlavourGenerator_H
10 #define ThePEG_FlavourGenerator_H
11 // This is the declaration of the FlavourGenerator class.
12 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/Handlers/HandlerBase.h"
15 
16 namespace ThePEG {
17 
40 
41 public:
42 
56  virtual tcPDPair generateHadron(tcPDPtr quark) const = 0;
57 
63 
74  virtual tcPDPtr getHadron(tcPDPtr q1, tcPDPtr q2) const;
75 
86  virtual tcPDPtr getHadron(long iq1, long iq2) const;
87 
92  tcPDPtr alwaysGetHadron(tcPDPtr q1, tcPDPtr q2) const;
93 
98  tcPDPtr alwaysGetHadron(long iq1, long iq2) const;
99 
112  virtual tcPDPtr getBaryon(tcPDPtr q1, tcPDPtr q2, tcPDPtr q3) const;
113 
126  virtual tcPDPtr getBaryon(long q1, long q2, long q3) const;
127 
132  tcPDPtr alwaysGetBaryon(tcPDPtr q1, tcPDPtr q2, tcPDPtr q3) const;
137  tcPDPtr alwaysGetBaryon(long q1, long q2, long q3) const;
138 
142  virtual long selectQuark() const = 0;
143 
147  virtual long selectFlavour() const = 0;
149 
150 public:
151 
158  void persistentOutput(PersistentOStream & os) const;
159 
165  void persistentInput(PersistentIStream & is, int version);
167 
171  static void Init();
172 
173 
174 private:
175 
180 
184  FlavourGenerator & operator=(const FlavourGenerator &) = delete;
185 
186 };
187 
191 class FlavourGeneratorException: public Exception {};
200 template <>
201 struct BaseClassTrait<FlavourGenerator,1>: public ClassTraitsType {
203  typedef HandlerBase NthBase;
204 };
205 
210 template <>
211 struct ClassTraits<FlavourGenerator>:
212  public ClassTraitsBase<FlavourGenerator> {
214  static string className() {
215  return "ThePEG::FlavourGenerator";
216  }
217 };
218 
221 }
222 
223 #endif /* ThePEG_FlavourGenerator_H */
pair< tcPDPtr, tcPDPtr > tcPDPair
A pair of transient pointers to const ParticleData objects.
Definition: Containers.h:124
PersistentIStream is used to read persistent objects from a stream where they were previously written...
tcPDPtr alwaysGetHadron(tcPDPtr q1, tcPDPtr q2) const
Same as getHadron(tcPDPtr, tcPDPtr) but thows an exception if no hadron could be produced.
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
virtual long selectQuark() const =0
Generate a random quark flavour.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
static void Init()
Standard Init function used to initialize the interface.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
tcPDPtr alwaysGetBaryon(tcPDPtr q1, tcPDPtr q2, tcPDPtr q3) const
Same as getBaryon(tcPDPtr, tcPDPtr, tcPDPtr), but throws an exception if no baryon could be produced...
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
This is the main config header file for ThePEG.
FlavourGenerator is an abstract base class to be used to implement models describing the quark conten...
tcPDPair alwaysGenerateHadron(tcPDPtr quark) const
Same as generateHadron(tcPDPtr), but throws an exception if no hadron could be produced.
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
virtual tcPDPair generateHadron(tcPDPtr quark) const =0
Generate a hadron from a quark.
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
Exception is the base class for all exceptions to be used in ThePEG.
Definition: Exception.h:44
virtual tcPDPtr getBaryon(tcPDPtr q1, tcPDPtr q2, tcPDPtr q3) const
Return a baryon with the flavour content given by the (anti)quarks in the argument.
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
virtual long selectFlavour() const =0
Generate a random (di)quark flavour.
static AbstractNoPIOClassDescription< FlavourGenerator > initFlavourGenerator
Describe aa abstract class without persistent data.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
virtual tcPDPtr getHadron(tcPDPtr q1, tcPDPtr q2) const
Get hadron from flavours.
FlavourGenerator & operator=(const FlavourGenerator &)=delete
Private and non-existent assignment operator.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52