herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Col_str.h
1// -*- C++ -*-
2/*
3 * Col_str.h
4 * Contains declaration of the class Col_str and associated types and operators.
5 * Created on: Jul 7, 2010
6 * Author: Malin Sjodahl
7 */
8
9#ifndef COLORFULL_Col_str_h
10#define COLORFULL_Col_str_h
11
12#include "Quark_line.h"
13
14namespace ColorFull {
15
20typedef std::vector < Quark_line > col_str;
21
22
26class Col_str {
27public:
28
31
38 Col_str( const std::string str );
39
41 Col_str( Quark_line Ql ) {cs.push_back(Ql);}
42
46 col_str cs;
47
50
52 const Quark_line & at( int i ) const {return cs.at(i);}
53
55 Quark_line & at( int i ) {return cs.at(i);}
56
58 int at( int i, int j ) const;
59
61 uint size() const{ return cs.size(); }
62
64 bool empty() const { return cs.empty(); }
65
67 void clear() { cs.clear(); }
68
70 void erase( int i );
71
73 void erase( int i, int j );
74
76 void erase(std::pair<int, int> place);
77
79 void append( Quark_line Ql ) { cs.push_back( Ql ); }
80
83 void insert( int i, int j, int part_num );
84
86 void append( col_str cs_in );
87
89 void read_in_Col_str( std::string filename );
90
93 void write_out_Col_str( std::string filename ) const;
94
96 std::pair<int, int> find_parton( int part_num ) const;
97
99 bool neighbor( int p1, int p2 ) const;
100
102 bool right_neighbor( int p1, int p2 ) const;
103
105 bool left_neighbor( int p1, int p2 ) const;
106
108 void replace( int old_ind, int new_ind );
109
115 std::string find_kind( int p ) const;
116
118 bool gluons_only() const;
119
122 int n_gluon() const;
123
126 int n_quark() const;
127
134
148 int smallest( const Col_str & Cs1, const Col_str & Cs2 ) const;
149
152
155
158
163 void simplify();
164
167 void conjugate();
168
173
179
182 void contract_quarks( const Col_str Cs1, const Col_str Cs2 );
183
184
185private:
186
191 int compare_quark_lines( int i1, int i2 ) const;
192
195 void Col_str_of_str( const std::string str );
196
200 void col_str_of_str( std::string );
201
202}; //end class Col_str
203
204
210bool operator==(const col_str & cs1, const col_str & cs2);
211
214bool operator!=(const col_str & cs1, const col_str & cs2);
215
217std::ostream& operator<<( std::ostream& out, const col_str & cs );
218
220Col_str operator*( const Col_str & Cs, const int i );
221
223Col_str operator*( const int i, const Col_str & Cs );
224
226Col_str operator*( const Col_str & Cs, const double d );
227
229Col_str operator*( const double d, const Col_str & Cs );
230
232Col_str operator*( const Col_str & Cs, const cnum c);
233
235Col_str operator*( const cnum c, const Col_str & Cs );
236
238Col_str operator*( const Col_str & Cs, const Monomial & Mon );
239
241Col_str operator*( const Monomial & Mon, const Col_str & Cs);
242
244Col_str operator*( const Col_str & Cs, const Polynomial & Poly );
245
247Col_str operator*( const Polynomial & Poly, const Col_str & Cs );
248
250Col_str operator*( const Col_str & Cs, const Quark_line & Ql);
251
253Col_str operator*( const Quark_line & Ql, const Col_str & Cs );
254
256Col_str operator*( const Col_str & Cs1, const Col_str & Cs2 );
257
260Col_str operator*( const Quark_line & Ql1, const Quark_line & Ql2 );
261
263std::ostream& operator<<(std::ostream& out, const Col_str & Cs);
264
269bool operator==( const Col_str & Cs1, const Col_str & Cs2 );
270
273bool operator!=( const Col_str & Cs1, const Col_str & Cs2 );
274
275}
276
277#endif /* COLORFULL_Col_str_h */
A class to contain ONE color structure, a direct product of Quark_lines, multiplying a Polynomial,...
Definition: Col_str.h:26
void clear()
Erase information in col_str.
Definition: Col_str.h:67
void append(Quark_line Ql)
Appends a Quark_line to data member cs.
Definition: Col_str.h:79
void read_in_Col_str(std::string filename)
Function for reading in the Col_str from the file filename.
void Col_str_of_str(const std::string str)
Function to allow setting the color structure by using a string.
void remove_0_rings()
Removes Quark_lines without partons, equal to Nc (closed) or 1 (open).
void erase(std::pair< int, int > place)
Erases a parton at location place.
const Quark_line & at(int i) const
Returns the Quark_line at place i.
Definition: Col_str.h:52
Col_str()
Default constructor, leaves cs empty.
Definition: Col_str.h:30
bool empty() const
Is the col_str empty?
Definition: Col_str.h:64
int n_gluon() const
Counts the number of gluons in a Col_str.
int at(int i, int j) const
Returns the parton at place j in Quark_line i.
void write_out_Col_str(std::string filename) const
Function for writing out the Col_str to a file with name filename.
void erase(int i, int j)
Erases the parton at place i, j.
void append(col_str cs_in)
Append the content of a col_str to the cs of the Col_str.
Quark_line & at(int i)
Returns the Quark_line at place i.
Definition: Col_str.h:55
void remove_1_rings()
Removes Quark_lines with only one gluon as Tr(t^a)=0.
bool neighbor(int p1, int p2) const
Function for telling if the partons p1 and p2 are neighbors.
std::pair< int, int > find_parton(int part_num) const
Locates the parton with number part_num in a Col_str.
void conjugate()
Function for conjugating the Col_str by conjugating each Quark_line in cs, as well as the Polynomial ...
void simplify()
Removes 0 and 1-rings, moves factors multiplying the individual Quark_lines to multiply the col_str i...
Col_str(const std::string str)
Constructor for setting the color structure using a string.
bool right_neighbor(int p1, int p2) const
Function for telling if parton p2 stands to the right of parton p1.
col_str cs
For containing the information about the color structure, a direct product of Quark_lines,...
Definition: Col_str.h:46
int compare_quark_lines(int i1, int i2) const
Function to tell which quark_line should stand first in normal order.
void insert(int i, int j, int part_num)
To insert the parton part_num in quark_line i at place j.
void col_str_of_str(std::string)
Setting the col_str member cs (i.e.
int smallest(const Col_str &Cs1, const Col_str &Cs2) const
Finds out the "smallest" Col_str of two Col_strs, i.e.
void replace(int old_ind, int new_ind)
Replaces the parton index old_ind with new_ind.
int n_quark() const
Counts the number of quarks (=number of anti-quarks) in a Col_str.
uint size() const
The size of the col_str.
Definition: Col_str.h:61
bool gluons_only() const
Checks if the amplitude only has gluons, i.e. if all Quark_lines are closed.
bool left_neighbor(int p1, int p2) const
Function for telling if parton p2 stands to the left of parton p1.
void normal_order()
Normal orders the Col_str by first normal order individual Quark_lines and then normal order differen...
void contract_quarks(const Col_str Cs1, const Col_str Cs2)
Function for contracting quarks between two color structures Cs1 and Cs2.
void contract_next_neighboring_gluons()
Contracts neighboring and next to neighboring gluons in each Quark_line in the Col_str,...
void erase(int i)
Erases the Quark_line at place i.
int longest_quark_line() const
Returns the length of the longest Quark_line in the Col_str.
std::string find_kind(int p) const
Finds out if a parton is a quark, anti-quark or a gluon, returns "q", "qbar" or "g" respectively.
void contract_2_rings()
Function for contracting gluon indices in closed Quark_lines with only 2 gluons.
Polynomial Poly
Polynomial factor multiplying the whole product of quark-lines.
Definition: Col_str.h:49
Col_str(Quark_line Ql)
Make a Col_str of a Quark_line.
Definition: Col_str.h:41
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
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
string operator*(double, string)
ostream & operator<<(ostream &, const Collision &)