herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Quark_line.h
1// -*- C++ -*-
2/*
3 * Quark_line.h
4 * Contains declaration of the class Quark_line and associated types and operators.
5 * Created on: Jul 7, 2010
6 * Author: Malin Sjodahl
7 */
8
9#ifndef COLORFULL_Quark_line_h
10#define COLORFULL_Quark_line_h
11
12#include "Polynomial.h"
13
14
15namespace ColorFull {
16
17
21typedef std::vector <int> quark_line;
22
32
33public:
34
45 Quark_line( const std::string str );
46
49
52 quark_line ql;
53
56
58 bool open;
59
62 void read_in_Quark_line( std::string filename );
63
66 void write_out_Quark_line( std::string filename ) const;
67
70 int at( int j ) const;
71
73 uint size() const{ return ql.size();}
74
76 void clear() { ql.clear(); }
77
79 bool empty() const { return ql.empty(); }
80
85
87 void erase( int i );
88
91 void conjugate();
92
94 void append( int p ) { ql.push_back( p ); }
95
97 void append( const std::vector<int> & in_ql );
98
100 void prepend( int p );
101
103 void prepend( std::vector<int> in_ql );
104
106 void insert( int j, int p );
107
110 Quark_line before( int j ) const;
111
114 Quark_line after( int j ) const;
115
119 std::pair<Quark_line, Quark_line> split_Quark_line( int j1, int j2 ) const;
120
130 int smallest( const Quark_line & Ql1 , const Quark_line & Ql2 ) const;
131
135
139
144
148
149
150private:
151
160 void Quark_line_of_str( const std::string str );
161
165 void quark_line_of_str( std::string str );
166
167};
168
171Quark_line operator*( const Quark_line & Ql, const int i );
172
175Quark_line operator*( const int i, const Quark_line & Ql );
176
179Quark_line operator*( const Quark_line & Ql, const cnum c );
180
183Quark_line operator*( const cnum c, const Quark_line & Ql );
184
187
188Quark_line operator*( const Quark_line & Ql, const double d );
190
192Quark_line operator*( const double d, const Quark_line & Ql );
193
196Quark_line operator*( const Quark_line & Ql, const Monomial & Mon );
197
200Quark_line operator*( const Monomial & Mon, const Quark_line & Ql );
201
204Quark_line operator*( const Quark_line & Ql, const Polynomial & Poly );
205
208Quark_line operator*( const Polynomial & Poly, const Quark_line & Ql );
209
213bool operator==( const Quark_line & Ql1, const Quark_line & Ql2 );
214
216bool operator!=( const Quark_line & Ql1, const Quark_line & Ql2 );
217
218
220std::ostream& operator<<( std::ostream& out, const Quark_line & Ql );
221
222
223}// end namespace ColorFull
224
225#endif /* COLORFULL_Quark_line_h */
A class to contain the factor of form TR^a*Nc^b*CF^c*int_part*cnum_part, where the powers a,...
Definition: Monomial.h:23
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Definition: Polynomial.h:30
A class to contain one quark-line with gluons attached multiplying a Polynomial, Poly.
Definition: Quark_line.h:31
void insert(int j, int p)
Inserting parton p at place j.
void prepend(int p)
Prepends parton p to the Quark_line.
bool open
Is the string open, with a q in the beginning and a qbar in the end, or not?
Definition: Quark_line.h:58
bool empty() const
Is the quark_line empty?
Definition: Quark_line.h:79
std::pair< Quark_line, Quark_line > split_Quark_line(int j1, int j2) const
Function for splitting a closed Quark_line into two Quark_lines.
quark_line ql
To actually contain the color information, in order {q, g1, ... gn, qbar} or (g1, ....
Definition: Quark_line.h:52
void quark_line_of_str(std::string str)
To make it easy to define a Quark_line using a string, used by Quark_line_of_str(std::string str) to ...
void contract_neighboring_gluons(int j)
Contracts neighboring gluons in the Quark_line starting at j, only intended for closed Quark_lines.
void Quark_line_of_str(const std::string str)
Function used to set the color structure using a string.
void contract_neighboring_gluons()
Contracts neighboring gluons in a Quark_line starting at place 0, and checking all neighbors,...
void append(const std::vector< int > &in_ql)
Appends a whole quark_line to the Quark_line.
void append(int p)
Appends parton p to the Quark_line.
Definition: Quark_line.h:94
void clear()
Erase information in quark_line ql.
Definition: Quark_line.h:76
void erase(int i)
To erase the parton at place i.
void contract_next_neighboring_gluons()
Contracts neighboring and next to neighboring gluons in the Quark_line, starting with contracting nei...
void normal_order()
If the quark_line is open, there is nothing to do, else order with smallest gluon index first (use th...
int smallest(const Quark_line &Ql1, const Quark_line &Ql2) const
Function for finding the "smallest" Quark_line of Ql1 and Ql2, used for deciding which Quark_line sho...
void conjugate()
Conjugates the Quark_line by reversing the quark_line ql and conjugating the Polynomial Poly.
Quark_line()
Default constructor.
void read_in_Quark_line(std::string filename)
Function for reading in the Quark_line from the file filename, uses Quark_line_of_str.
Quark_line(const std::string str)
Constructor used to set the color structure using a string.
Quark_line before(int j) const
Returns a Quark_line where the ql member is changed to contain only partons before place j.
uint size() const
The size of the quark_line.
Definition: Quark_line.h:73
void contract_next_neighboring_gluons(int j)
Contracts neighboring and next to neighboring gluons in the Quark_line, starting at place j (i....
void write_out_Quark_line(std::string filename) const
Function for writing out the Quark_line to a file with name filename.
Quark_line after(int j) const
Returns a Quark_line where the ql member is changed to contain only partons after place j.
Polynomial Poly
Polynomial factor, multiplying the quark_line.
Definition: Quark_line.h:55
void prepend(std::vector< int > in_ql)
Prepends a whole quark_line to the Quark_line.
int at(int j) const
Returns the parton at place j.
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
string operator*(double, string)
ostream & operator<<(ostream &, const Collision &)