herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
Models
Susy
MixingMatrix.h
1
// -*- C++ -*-
2
//
3
// MixingMatrix.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_MixingMatrix_H
10
#define HERWIG_MixingMatrix_H
11
12
//
13
// This is the declaration of the MixingMatrix class.
14
//
15
16
#include "ThePEG/Interface/Interfaced.h"
17
#include "ThePEG/Config/Complex.h"
18
#include "MixingMatrix.fh"
19
#include "ThePEG/Utilities/Exception.h"
20
21
namespace
Herwig
{
22
using namespace
ThePEG
;
23
24
/*@name Some convenient typedefs. */
26
30
typedef
vector<vector<Complex> >
CMatrix
;
31
35
struct
MixingElement
{
36
40
MixingElement
(
unsigned
int
irow,
unsigned
int
icol,
Complex
ivalue)
41
:
row
(irow),
col
(icol),
value
(ivalue) {}
42
46
unsigned
int
row
;
47
51
unsigned
int
col
;
52
56
Complex
value
;
57
};
58
62
typedef
vector<MixingElement>
MixingVector
;
63
67
typedef
pair<unsigned int, unsigned int>
MatrixSize
;
69
78
class
MixingMatrix
:
public
Interfaced
{
79
81
class
MixingMatrixError
:
public
Exception
{};
82
83
public
:
84
92
MixingMatrix
(
const
CMatrix
& mix,
const
vector<long> & ids) :
93
mixingMatrix_
(mix),
ids_
(ids),
size_
(make_pair(mix.
size
(),mix[0].
size
()))
94
{}
95
99
MixingMatrix
(
unsigned
int
row,
unsigned
int
col) :
100
mixingMatrix_
(row,vector<
Complex
>(col,
Complex
(0.,0.))),
size_
(row,col)
101
{}
102
106
MixingMatrix
() {}
108
109
public
:
110
117
void
persistentOutput
(
PersistentOStream
& os)
const
;
118
124
void
persistentInput
(
PersistentIStream
& is,
int
version);
126
133
static
void
Init
();
134
141
void
setMatrix
(
const
CMatrix
& mixing) {
142
mixingMatrix_
= mixing;
143
size_
= make_pair(mixing.size(),mixing[0].size());
144
}
145
149
CMatrix
getMatrix
()
const
{
return
mixingMatrix_
;}
150
155
void
setIds
(
const
vector<long> & mixingCodes) {
156
if
(mixingCodes.size() !=
size_
.first) {
157
ostringstream codes;
158
for
(
unsigned
int
ix=0;ix<mixingCodes.size();++ix)
159
codes << mixingCodes[ix] <<
" "
;
160
throw
MixingMatrixError
() <<
"MixingMatrix::setIds() - The number "
161
<<
"of PDG codes ("
<< mixingCodes.size()
162
<<
") does not match the size of the "
163
<<
"matrix ("
<<
size_
.first
164
<<
")"
165
<<
"Ids are "
<< codes.str()
166
<<
Exception::warning
;
167
return
;
168
}
169
ids_
= mixingCodes;
170
}
171
175
const
vector<long> &
getIds
()
const
{
return
ids_
;}
177
182
void
adjustPhase
(
long
id
);
183
187
const
Complex
operator()
(
unsigned
int
row,
unsigned
int
col)
const
{
188
return
mixingMatrix_
.at(row).at(col);
189
}
190
194
Complex
&
operator()
(
unsigned
int
row,
unsigned
int
col) {
195
return
mixingMatrix_
.at(row).at(col);
196
}
197
201
void
addCode
(
long
id
) {
202
if
(
ids_
.size() >=
size_
.first) {
203
throw
MixingMatrixError
() <<
"MixingMatrix::addCode() - Trying to add a"
204
<<
"PDG code but the vector already contains the "
205
<<
"same number as the matrix size "
206
<<
Exception::warning
;
207
return
;
208
}
209
ids_
.push_back(
id
);
210
}
211
215
MatrixSize
size
()
const
{
return
size_
;}
216
217
protected
:
218
225
virtual
IBPtr
clone
()
const
{
return
new_ptr(*
this
);}
226
231
virtual
IBPtr
fullclone
()
const
{
return
new_ptr(*
this
);}
233
234
private
:
235
240
MixingMatrix
&
operator=
(
const
MixingMatrix
&) =
delete
;
241
245
CMatrix
mixingMatrix_
;
246
250
vector<long>
ids_
;
251
255
pair<unsigned int,unsigned int>
size_
;
256
260
friend
ostream &
operator<<
(ostream & os,
const
MixingMatrix
& mix);
261
};
262
266
ostream &
operator<<
(ostream &,
const
MixingMatrix
&);
267
}
268
269
#endif
/* HERWIG_MixingMatrix_H */
Herwig::MixingMatrix::MixingMatrixError
Exception class to indicate problem with mixing matrix .
Definition:
MixingMatrix.h:81
Herwig::MixingMatrix
This class is desinged to store the mixing matrices needed for Susy studies.
Definition:
MixingMatrix.h:78
Herwig::MixingMatrix::operator<<
friend ostream & operator<<(ostream &os, const MixingMatrix &mix)
Print the matrix to the stream.
Herwig::MixingMatrix::mixingMatrix_
CMatrix mixingMatrix_
The mixing matrix.
Definition:
MixingMatrix.h:245
Herwig::MixingMatrix::MixingMatrix
MixingMatrix()
Standard Constructor.
Definition:
MixingMatrix.h:106
Herwig::MixingMatrix::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Herwig::MixingMatrix::size
MatrixSize size() const
Return the size of the mixing matrix.
Definition:
MixingMatrix.h:215
Herwig::MixingMatrix::MixingMatrix
MixingMatrix(unsigned int row, unsigned int col)
Contructor that initializes size of matrix.
Definition:
MixingMatrix.h:99
Herwig::MixingMatrix::ids_
vector< long > ids_
The PDG codes of the mixing particles.
Definition:
MixingMatrix.h:250
Herwig::MixingMatrix::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Definition:
MixingMatrix.h:231
Herwig::MixingMatrix::MixingMatrix
MixingMatrix(const CMatrix &mix, const vector< long > &ids)
Constructor that takes a mixing matrix and a vector id's as arguments.
Definition:
MixingMatrix.h:92
Herwig::MixingMatrix::getIds
const vector< long > & getIds() const
Get the vector containing mixing particles codes.
Definition:
MixingMatrix.h:175
Herwig::MixingMatrix::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
Herwig::MixingMatrix::getMatrix
CMatrix getMatrix() const
Get the mixing matrix.
Definition:
MixingMatrix.h:149
Herwig::MixingMatrix::setIds
void setIds(const vector< long > &mixingCodes)
Set the vector containing mixing particles codes.
Definition:
MixingMatrix.h:155
Herwig::MixingMatrix::Init
static void Init()
The standard Init function used to initialize the interfaces.
Herwig::MixingMatrix::adjustPhase
void adjustPhase(long id)
Multiply row corresponding to id by .
Herwig::MixingMatrix::operator=
MixingMatrix & operator=(const MixingMatrix &)=delete
The assignment operator is private and must never be called.
Herwig::MixingMatrix::setMatrix
void setMatrix(const CMatrix &mixing)
Set the mixing matrix.
Definition:
MixingMatrix.h:141
Herwig::MixingMatrix::size_
pair< unsigned int, unsigned int > size_
Size of matrix.
Definition:
MixingMatrix.h:255
Herwig::MixingMatrix::clone
virtual IBPtr clone() const
Make a simple clone of this object.
Definition:
MixingMatrix.h:225
Herwig::MixingMatrix::operator()
const Complex operator()(unsigned int row, unsigned int col) const
Access element of matrix.
Definition:
MixingMatrix.h:187
Herwig::MixingMatrix::operator()
Complex & operator()(unsigned int row, unsigned int col)
Set element of matrix.
Definition:
MixingMatrix.h:194
Herwig::MixingMatrix::addCode
void addCode(long id)
Add a PDG code to the stored vector.
Definition:
MixingMatrix.h:201
ThePEG::Exception
ThePEG::Exception::warning
warning
ThePEG::Interfaced
ThePEG::PersistentIStream
ThePEG::PersistentOStream
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
Herwig::MixingVector
vector< MixingElement > MixingVector
A vector of mixing elements.
Definition:
MixingMatrix.h:62
Herwig::MatrixSize
pair< unsigned int, unsigned int > MatrixSize
The size of the matrix.
Definition:
MixingMatrix.h:67
Herwig::CMatrix
vector< vector< Complex > > CMatrix
A complex valued nested vector.
Definition:
MixingMatrix.h:30
ThePEG
ThePEG::Complex
std::complex< double > Complex
ThePEG::IBPtr
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::operator<<
ostream & operator<<(ostream &, const Collision &)
Herwig::MixingElement
Struct for the elements of a mixing matrix.
Definition:
MixingMatrix.h:35
Herwig::MixingElement::row
unsigned int row
row
Definition:
MixingMatrix.h:46
Herwig::MixingElement::MixingElement
MixingElement(unsigned int irow, unsigned int icol, Complex ivalue)
Constructor.
Definition:
MixingMatrix.h:40
Herwig::MixingElement::col
unsigned int col
column
Definition:
MixingMatrix.h:51
Herwig::MixingElement::value
Complex value
value
Definition:
MixingMatrix.h:56
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6