herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
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 
15 namespace ColorFull {
16 
17 
21 typedef std::vector <int> quark_line;
22 
31 class Quark_line {
32 
33 public:
34 
45  Quark_line( const std::string str );
46 
48  Quark_line();
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 
84  void normal_order();
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 
134  void contract_neighboring_gluons( int j );
135 
139 
143  void contract_next_neighboring_gluons( int j );
144 
148 
149 
150 private:
151 
160  void Quark_line_of_str( const std::string str );
161 
165  void quark_line_of_str( std::string str );
166 
167 };
168 
171 Quark_line operator*( const Quark_line & Ql, const int i );
172 
175 Quark_line operator*( const int i, const Quark_line & Ql );
176 
179 Quark_line operator*( const Quark_line & Ql, const cnum c );
180 
183 Quark_line operator*( const cnum c, const Quark_line & Ql );
184 
187 
188 Quark_line operator*( const Quark_line & Ql, const double d );
190 
192 Quark_line operator*( const double d, const Quark_line & Ql );
193 
196 Quark_line operator*( const Quark_line & Ql, const Monomial & Mon );
197 
200 Quark_line operator*( const Monomial & Mon, const Quark_line & Ql );
201 
204 Quark_line operator*( const Quark_line & Ql, const Polynomial & Poly );
205 
208 Quark_line operator*( const Polynomial & Poly, const Quark_line & Ql );
209 
213 bool operator==( const Quark_line & Ql1, const Quark_line & Ql2 );
214 
216 bool operator!=( const Quark_line & Ql1, const Quark_line & Ql2 );
217 
218 
220 std::ostream& operator<<( std::ostream& out, const Quark_line & Ql );
221 
222 
223 }// end namespace ColorFull
224 
225 #endif /* COLORFULL_Quark_line_h */
auto operator*(const ThreeVector< ValueA > &a, const ThreeVector< ValueB > &b) -> decltype(a.x() *b.x())
void normal_order()
If the quark_line is open, there is nothing to do, else order with smallest gluon index first (use th...
void insert(int j, int p)
Inserting parton p at place j.
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
void clear()
Erase information in quark_line ql.
Definition: Quark_line.h:76
void contract_next_neighboring_gluons()
Contracts neighboring and next to neighboring gluons in the Quark_line, starting with contracting nei...
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
int at(int j) const
Returns the parton at place j.
bool empty() const
Is the quark_line empty?
Definition: Quark_line.h:79
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Definition: Polynomial.h:30
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 after(int j) const
Returns a Quark_line where the ql member is changed to contain only partons after place j...
void append(int p)
Appends parton p to the Quark_line.
Definition: Quark_line.h:94
void prepend(int p)
Prepends parton p to the Quark_line.
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 Quark_line_of_str(const std::string str)
Function used to set the color structure using a string.
uint size() const
The size of the quark_line.
Definition: Quark_line.h:73
void erase(int i)
To erase the parton at place i.
Quark_line before(int j) const
Returns a Quark_line where the ql member is changed to contain only partons before place j...
A class to contain one quark-line with gluons attached multiplying a Polynomial, Poly.
Definition: Quark_line.h:31
Polynomial Poly
Polynomial factor, multiplying the quark_line.
Definition: Quark_line.h:55
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
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...
vector< T > & operator<<(vector< T > &tv, const U &u)
void write_out_Quark_line(std::string filename) const
Function for writing out the Quark_line to a file with name filename.
Quark_line()
Default constructor.
quark_line ql
To actually contain the color information, in order {q, g1, ...
Definition: Quark_line.h:52
void contract_neighboring_gluons()
Contracts neighboring gluons in a Quark_line starting at place 0, and checking all neighbors...
void read_in_Quark_line(std::string filename)
Function for reading in the Quark_line from the file filename, uses Quark_line_of_str.