thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
MultiColour.h
1 // -*- C++ -*-
2 //
3 // MultiColour.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_MultiColour_H
10 #define THEPEG_MultiColour_H
11 //
12 // This is the declaration of the MultiColour class.
13 //
14 
15 #include "ThePEG/EventRecord/ColourBase.h"
16 
17 namespace ThePEG {
18 
24 class MultiColour: public ColourBase {
25 
26 public:
27 
30 
35  virtual vector<tcColinePtr> antiColourLines() const;
36 
41  virtual vector<tcColinePtr> colourLines() const;
42 
47  virtual void colourLine(tColinePtr line, bool anti = false);
48 
53  virtual void colourLine(tColinePtr line, int index, bool anti = false);
54 
59  virtual void antiColourLine(tColinePtr line);
60 
65  virtual void antiColourLine(tColinePtr line, int index);
66 
72  virtual void removeColourLine(tcColinePtr line, bool anti = false);
73 
79  virtual void removeAntiColourLine(tcColinePtr line);
80 
85  virtual bool hasColourLine(tcColinePtr line, bool anti = false) const;
86 
87 public:
88 
95  void persistentOutput(PersistentOStream & os) const;
96 
102  void persistentInput(PersistentIStream & is, int version);
104 
111  static void Init();
112 
116  virtual EIPtr clone() const { return new_ptr(*this); }
117 
118 private:
119 
123  list<cColinePtr> theColourLines;
124 
128  list<cColinePtr> theAntiColourLines;
129 
130 private:
131 
137 
142  MultiColour & operator=(const MultiColour &) = delete;
143 
144 };
145 
146 }
147 
148 #include "ThePEG/Utilities/ClassTraits.h"
149 
150 namespace ThePEG {
151 
156 template <>
157 struct BaseClassTrait<MultiColour,1> {
159  typedef ColourBase NthBase;
160 };
161 
164 template <>
165 struct ClassTraits<MultiColour>
166  : public ClassTraitsBase<MultiColour> {
168  static string className() { return "ThePEG::MultiColour"; }
176  static string library() { return "MultiColour.so"; }
177 };
178 
181 }
182 
183 #endif /* THEPEG_MultiColour_H */
Ptr< T >::pointer new_ptr()
Simple interface to the PtrTraits<Ptr>::create()
Definition: PtrTraits.h:195
PersistentIStream is used to read persistent objects from a stream where they were previously written...
virtual vector< tcColinePtr > colourLines() const
Return the colour lines to which this particle is connected.
This class is used to store colour information of RemnantParticle objects and other particle classes ...
Definition: MultiColour.h:24
list< cColinePtr > theAntiColourLines
The set of anti-colour lines to which a particle is attached.
Definition: MultiColour.h:128
virtual vector< tcColinePtr > antiColourLines() const
Return the anti-colour lines to which this particle is connected.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
virtual bool hasColourLine(tcColinePtr line, bool anti=false) const
Return true if the particle is connected to the given (anti-) colour line.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
MultiColour & operator=(const MultiColour &)=delete
The assignment operator is private and must never be called.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
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
static void Init()
The standard Init function used to initialize the interfaces.
virtual void removeAntiColourLine(tcColinePtr line)
Remove the given anti-colour line from the particle.
tColinePtr antiColourLine() const
Return the anti-colour line to which this particle is connected.
Definition: ColourBase.h:44
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
virtual EIPtr clone() const
Standard clone method.
Definition: MultiColour.h:116
ColourBase is the base class to be used to supply a Particle with information about its colour state...
Definition: ColourBase.h:32
static ClassDescription< MultiColour > initMultiColour
The static object used to initialize the description of this class.
Definition: MultiColour.h:136
list< cColinePtr > theColourLines
The set of colour lines to which a particle is attached.
Definition: MultiColour.h:123
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
tColinePtr colourLine() const
Return the colour line to which this particle is connected.
Definition: ColourBase.h:49
virtual void removeColourLine(tcColinePtr line, bool anti=false)
Remove the given (anti-) colour line from the particle.
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
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.