00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_ColourSinglet_H
00010 #define ThePEG_ColourSinglet_H
00011
00012 #include "ThePEG/EventRecord/EventConfig.h"
00013
00014 namespace ThePEG {
00015
00031 class ColourSinglet {
00032
00033 public:
00034
00036 typedef deque<tcPPtr> StringPiece;
00038 typedef StringPiece::size_type Index;
00040 typedef pair<Index,Index> Junction;
00041
00042 public:
00043
00047 ColourSinglet() {}
00048
00053 ColourSinglet(tcColinePtr cl, tcParticleSet & left);
00054
00055 protected:
00056
00062 ColourSinglet(const ColourSinglet & cs, Index si);
00063
00064 public:
00065
00069 tcPVector & partons() { return thePartons; }
00070
00074 const tcPVector & partons() const { return thePartons; }
00075
00079 tcPPtr parton(tcPVector::size_type i) const { return thePartons[i]; }
00080
00084 LorentzMomentum momentum() const;
00085
00089 Index nPieces() const { return thePieces.size(); }
00090
00095 StringPiece & piece(Index i) { return thePieces[i - 1]; }
00096
00101 const StringPiece & piece(Index i) const { return thePieces[i - 1]; }
00102
00107 Junction & junction(Index i, bool forward) {
00108 return forward ? sink(i) : source(i);
00109 }
00110
00115 const Junction & junction(Index i, bool forward) const {
00116 return forward ? sink(i) : source(i);
00117 }
00118
00123 Junction & sink(Index i) { return theSinks[i - 1]; }
00124
00129 const Junction & sink(Index i) const { return theSinks[i - 1]; }
00130
00135 Junction & source(Index i) { return theSources[i - 1]; }
00140 const Junction & source(Index i) const { return theSources[i - 1]; }
00141
00147 static vector<ColourSinglet> getSinglets(tcParticleSet & left);
00148
00153 template <typename Iterator>
00154 static vector<ColourSinglet>
00155 getSinglets(Iterator first, Iterator last) {
00156 tcParticleSet pset(first, last);
00157 return getSinglets(pset);
00158 }
00159
00164 tcPDVector getTripletData() const;
00165
00175 ColourSinglet splitInternal(Index sp = 0);
00176
00186 ColourSinglet splitInternal(Index sp, Index sa, Index sc,
00187 const vector<bool> & assing);
00188
00199 ColourSinglet
00200 splitDiQuarkJunction(Index sp, tcPPtr diq, tcPPair qq,
00201 const vector<bool> & assign = vector<bool>());
00202
00214 ColourSinglet splitDiDiQuark(tcPPair qq1, tcPPair qq2,
00215 const vector<bool> & assign = vector<bool>());
00216
00220 void swap(ColourSinglet & x) {
00221 thePartons.swap(x.thePartons);
00222 thePieces.swap(x.thePieces);
00223 theSources.swap(x.theSources);
00224 theSinks.swap(x.theSinks);
00225 }
00226
00227 private:
00228
00236 bool fill(Index s0, bool forward, tcColinePtr first, tcParticleSet & left);
00237
00243 void fill(Index i0, bool forward, const ColourSinglet & cs, Index i1);
00244
00248 Index addPiece() {
00249 thePieces.push_back(StringPiece());
00250 theSinks.push_back(Junction());
00251 theSources.push_back(Junction());
00252 return nPieces();
00253 }
00254
00260 Junction addJunction(Index s0, bool forward);
00261
00262 public:
00263
00267 class ColourSingletException: public Exception {};
00270 private:
00271
00275 tcPVector thePartons;
00276
00280 vector<StringPiece> thePieces;
00281
00285 vector<Junction> theSources;
00286
00290 vector<Junction> theSinks;
00291
00292 };
00293
00294 }
00295
00296 #endif