thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ColourSinglet.h
1// -*- C++ -*-
2//
3// ColourSinglet.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_ColourSinglet_H
10#define ThePEG_ColourSinglet_H
11
13
14namespace ThePEG {
15
32
33public:
34
36 typedef deque<tcPPtr> StringPiece;
38 typedef StringPiece::size_type Index;
40 typedef pair<Index,Index> Junction;
41
42public:
43
48
54
55protected:
56
63
64public:
65
70
74 const tcPVector & partons() const { return thePartons; }
75
79 tcPPtr parton(tcPVector::size_type i) const { return thePartons[i]; }
80
85
89 Index nPieces() const { return thePieces.size(); }
90
95 StringPiece & piece(Index i) { return thePieces[i - 1]; }
96
101 const StringPiece & piece(Index i) const { return thePieces[i - 1]; }
102
107 Junction & junction(Index i, bool forward) {
108 return forward ? sink(i) : source(i);
109 }
110
115 const Junction & junction(Index i, bool forward) const {
116 return forward ? sink(i) : source(i);
117 }
118
123 Junction & sink(Index i) { return theSinks[i - 1]; }
124
129 const Junction & sink(Index i) const { return theSinks[i - 1]; }
130
135 Junction & source(Index i) { return theSources[i - 1]; }
140 const Junction & source(Index i) const { return theSources[i - 1]; }
141
147 static vector<ColourSinglet> getSinglets(tcParticleSet & left);
148
153 template <typename Iterator>
154 static vector<ColourSinglet>
155 getSinglets(Iterator first, Iterator last) {
156 tcParticleSet pset(first, last);
157 return getSinglets(pset);
158 }
159
165
176
187 const vector<bool> & assing);
188
201 const vector<bool> & assign = vector<bool>());
202
215 const vector<bool> & assign = vector<bool>());
216
220 void swap(ColourSinglet & x) {
221 thePartons.swap(x.thePartons);
222 thePieces.swap(x.thePieces);
223 theSources.swap(x.theSources);
224 theSinks.swap(x.theSinks);
225 }
226
227private:
228
236 bool fill(Index s0, bool forward, tcColinePtr first, tcParticleSet & left);
237
243 void fill(Index i0, bool forward, const ColourSinglet & cs, Index i1);
244
249 thePieces.push_back(StringPiece());
250 theSinks.push_back(Junction());
251 theSources.push_back(Junction());
252 return nPieces();
253 }
254
260 Junction addJunction(Index s0, bool forward);
261
262public:
263
267 class ColourSingletException: public Exception {};
270private:
271
276
280 vector<StringPiece> thePieces;
281
285 vector<Junction> theSources;
286
290 vector<Junction> theSinks;
291
292};
293
294}
295
296#endif /* ThePEG_ColourSinglet_H */
This is the main config header file for the Event classes.
A ColourSinglet object represents a set of colour-connected partons in a total colour-singlet state.
Definition: ColourSinglet.h:31
Junction & sink(Index i)
Return the sink or source neighbors of a string piece with index i (note that the indices starts with...
const Junction & sink(Index i) const
Return the sink or source neighbors of a string piece with index i (note that the indices starts with...
ColourSinglet splitInternal(Index sp, Index sa, Index sc, const vector< bool > &assing)
Split a junction string.
ColourSinglet splitDiDiQuark(tcPPair qq1, tcPPair qq2, const vector< bool > &assign=vector< bool >())
Split a di-quark string.
Junction & junction(Index i, bool forward)
Return the sink (or source if forward is false) neighbors of a string piece with index i (note that t...
const Junction & source(Index i) const
Return the sink or source neighbors of a string piece with index i (note that the indices starts with...
vector< StringPiece > thePieces
The different string pieces.
pair< Index, Index > Junction
Representaion of a junction.
Definition: ColourSinglet.h:40
vector< Junction > theSinks
The sink neighbours of the string pieces.
const tcPVector & partons() const
Access the vector of partons.
Definition: ColourSinglet.h:74
ColourSinglet splitDiQuarkJunction(Index sp, tcPPtr diq, tcPPair qq, const vector< bool > &assign=vector< bool >())
Split a junction string.
tcPPtr parton(tcPVector::size_type i) const
Access a parton giving an index.
Definition: ColourSinglet.h:79
deque< tcPPtr > StringPiece
A piece of string.
Definition: ColourSinglet.h:36
StringPiece::size_type Index
An integer type used as index in a string pieece.
Definition: ColourSinglet.h:38
ColourSinglet(tcColinePtr cl, tcParticleSet &left)
Constructor taking an initial colour line and a set of partons to select from.
Junction addJunction(Index s0, bool forward)
Add a junction which is a source (or sink if forward) to the string piece s0.
tcPVector & partons()
Access the vector of partons.
Definition: ColourSinglet.h:69
const Junction & junction(Index i, bool forward) const
Return the sink (or source if forward is false) neighbors of a string piece with index i (note that t...
static vector< ColourSinglet > getSinglets(tcParticleSet &left)
Extract colour-singlet strings/clusters of partons from the given set.
const StringPiece & piece(Index i) const
Return the partons belonging to string piece with index i (note that the indices starts with 1).
LorentzMomentum momentum() const
Return the total momentum for the partons in the colour singlet.
ColourSinglet(const ColourSinglet &cs, Index si)
Internal constructor.
Junction & source(Index i)
Return the sink or source neighbors of a string piece with index i (note that the indices starts with...
Index nPieces() const
Return the number of string pieces.
Definition: ColourSinglet.h:89
void fill(Index i0, bool forward, const ColourSinglet &cs, Index i1)
Fill a string piece.
void swap(ColourSinglet &x)
Swap this colour singlet for the argument.
StringPiece & piece(Index i)
Return the partons belonging to string piece with index i (note that the indices starts with 1).
Definition: ColourSinglet.h:95
tcPVector thePartons
The vector of all partons.
ColourSinglet()
Default constructor.
Definition: ColourSinglet.h:47
Index addPiece()
Add a new string piece and return its index.
tcPDVector getTripletData() const
Return a vector with data objects corresponding to all triplet partons in this singlet.
static vector< ColourSinglet > getSinglets(Iterator first, Iterator last)
Extract colour-singlet strings/clusters of partons from the given range of particles.
vector< Junction > theSources
The source neighbours of the string pieces.
bool fill(Index s0, bool forward, tcColinePtr first, tcParticleSet &left)
Fill a string piece.
ColourSinglet splitInternal(Index sp=0)
Split a junction string.
Exception is the base class for all exceptions to be used in ThePEG.
Definition: Exception.h:44
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
set< tcPPtr, less< tcPPtr > > tcParticleSet
A set of transient pointers to const Particle.
Definition: EventConfig.h:80
pair< tcPPtr, tcPPtr > tcPPair
A pair of transient pointers to const Particle objects.
Definition: Containers.h:136
ostream & left(ostream &os)
Stream manipulator setting an ostream to left-adjust its ouput.
Definition: std.h:161
vector< tcPPtr > tcPVector
A vector of transient pointers to const Particle objects.
Definition: Containers.h:85
vector< tcPDPtr > tcPDVector
A vector of transient pointers to const ParticleData objects.
Definition: Containers.h:42