herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
TwoBodyDecayMatrixElement.h
1 // -*- C++ -*-
2 //
3 // TwoBodyMatrixElement.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2019 The Herwig Collaboration
5 //
6 // Herwig 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 HERWIG_TwoBodyDecayMatrixElement_H
10 #define HERWIG_TwoBodyDecayMatrixElement_H
11 //
12 // This is the declaration of the TwoBodyDecayMatrixElement class.
13 
14 #include "DecayMatrixElement.h"
15 
16 namespace Herwig {
17 
18 using namespace ThePEG;
19 
20 
32 
33 public:
34 
41 
49  : DecayMatrixElement(2,spinin) {
50  outspin().push_back(outspin1);
51  outspin().push_back(outspin2);
52  }
53 
59  TwoBodyDecayMatrixElement(PDT::Spin inspin,vector<PDT::Spin> spinout)
60  : DecayMatrixElement(2,inspin) {
61  assert(spinout.size()==2);
62  outspin() = spinout;
63  }
64 
69  TwoBodyDecayMatrixElement(vector<PDT::Spin> extspin)
70  : DecayMatrixElement(2,extspin[0]) {
71  assert(extspin.size()==3);
72  outspin() = vector<PDT::Spin>(extspin.begin()+1,extspin.end());
73  }
75 
76 public:
77 
86  RhoDMatrix calculateDMatrix(const vector<RhoDMatrix> & rhoout) const;
87 
94  RhoDMatrix calculateRhoMatrix(int ipart,const RhoDMatrix & rhoin,
95  const vector<RhoDMatrix> & rhoout) const;
96 
102  Complex contract(const RhoDMatrix & rhoin) const;
103 
110  Complex contract(const TwoBodyDecayMatrixElement & con,
111  const RhoDMatrix & rhoin);
113 
114 public:
115 
126  Complex operator () (unsigned int inhel, unsigned int outhel1,
127  unsigned int outhel2) const {
128  return matrixElement_[inhel][outhel1][outhel2];
129  }
130 
137  Complex & operator () (unsigned int inhel, unsigned int outhel1,
138  unsigned int outhel2) {
139  return matrixElement_[inhel][outhel1][outhel2];
140  }
141 
145  Complex operator () (unsigned int , unsigned int ,
146  unsigned int , unsigned int ) const {
147  assert(false);
148  static const Complex out = 0.;
149  return out;
150  }
151 
155  Complex & operator () (unsigned int , unsigned int ,
156  unsigned int , unsigned int ) {
157  assert(false);
158  static Complex out = 0.;
159  return out;
160  }
161 
165  Complex operator () (unsigned int , unsigned int ,
166  unsigned int , unsigned int ,
167  unsigned int ) const {
168  assert(false);
169  static const Complex out = 0.;
170  return out;
171  }
172 
176  Complex & operator () (unsigned int , unsigned int ,
177  unsigned int , unsigned int ,
178  unsigned int ) {
179  assert(false);
180  static Complex out = 0.;
181  return out;
182  }
183 
193  Complex operator () (unsigned int , unsigned int ,
194  unsigned int , unsigned int ,
195  unsigned int , unsigned int ) const {
196  assert(false);
197  static const Complex out = 0.;
198  return out;
199  }
200 
204  Complex & operator () (unsigned int , unsigned int ,
205  unsigned int , unsigned int ,
206  unsigned int , unsigned int ) {
207  assert(false);
208  static Complex out = 0.;
209  return out;
210  }
211 
215  Complex operator () (unsigned int ,unsigned int ,
216  unsigned int ,unsigned int ,
217  unsigned int ,unsigned int ,
218  unsigned int ) const {
219  assert(false);
220  static const Complex out = 0.;
221  return out;
222  }
223 
227  Complex & operator () (unsigned int , unsigned int ,
228  unsigned int , unsigned int ,
229  unsigned int , unsigned int ,
230  unsigned int ) {
231  assert(false);
232  static Complex out = 0.;
233  return out;
234  }
235 
240  Complex operator () (const vector<unsigned int> & in) const {
241  assert(in.size()==3);
242  return matrixElement_[in[0]][in[1]][in[2]];
243  }
244 
249  Complex & operator () (const vector<unsigned int> & in) {
250  assert(in.size()==3);
251  return matrixElement_[in[0]][in[1]][in[2]];
252  }
254 
258  void zero() {
259  for(unsigned int ix=0;ix<5;++ix) {
260  for(unsigned int iy=0;iy<5;++iy) {
261  for(unsigned int iz=0;iz<5;++iz) {
262  matrixElement_[ix][iy][iz]=0.;
263  }
264  }
265  }
266  }
267 
268 private:
269 
273  Complex matrixElement_[5][5][5];
274 
275 };
276 
277 }
278 
279 #endif /* HERWIG_TwoBodyDecayMatrixElement_H */
std::complex< double > Complex
void zero()
Member to zero all the elements for the matrix element.
Here is the documentation of the DecayMatrixElement class.
TwoBodyDecayMatrixElement(PDT::Spin spinin, PDT::Spin outspin1, PDT::Spin outspin2)
Constructor for two body decay.
TwoBodyDecayMatrixElement(vector< PDT::Spin > extspin)
Constructor for arbitary body decay.
TwoBodyDecayMatrixElement(PDT::Spin inspin, vector< PDT::Spin > spinout)
Constructor for arbitary body decay.
-*- C++ -*-
TwoBodyDecayMatrixElement()
Default constructor.