herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
Models
General
TBDiagram.h
1
// -*- C++ -*-
2
//
3
// TBDiagram.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_TBDiagram_H
10
#define HERWIG_TBDiagram_H
11
//
12
// This is the declaration of the TBDiagram struct.
13
//
14
15
#include "ThePEG/Persistency/PersistentOStream.h"
16
#include "ThePEG/Persistency/PersistentIStream.h"
17
#include "ThePEG/Helicity/Vertex/VertexBase.h"
18
#include "ThePEG/Utilities/EnumIO.h"
19
#include "PrototypeVertex.h"
20
21
namespace
Herwig
{
22
using namespace
ThePEG
;
23
using
Helicity::VertexBasePtr;
24
26
typedef
pair<long, long>
IDPair
;
27
29
typedef
pair<bool, bool>
BPair
;
30
32
typedef
VertexBasePtr
VBPtr
;
33
35
typedef
pair<VBPtr, VBPtr>
VBPair
;
36
38
typedef
pair<unsigned int, double>
CFPair
;
39
44
struct
TBDiagram
{
45
47
enum
Channel
{UNDEFINED = -1, channel23=0, channel13=1, channel12=2, fourPoint=3};
48
50
TBDiagram
()
51
:
incoming
(0),
outgoing
(0),
outgoingPair
(make_pair(0, 0)),
52
channelType
(UNDEFINED),
colourFlow
(0),
ids
(4, 0)
53
{}
54
56
TBDiagram
(
long
a,
long
b,
IDPair
c)
57
:
incoming
(a),
outgoing
(b),
outgoingPair
(c),
58
channelType
(UNDEFINED),
colourFlow
(0),
ids
(4, 0) {
59
ids
[0] = a;
60
ids
[1] = b;
61
ids
[2] = c.first;
62
ids
[3] = c.second;
63
}
64
66
long
incoming
;
67
69
long
outgoing
;
70
72
IDPair
outgoingPair
;
73
75
PDPtr
intermediate
;
76
78
VBPair
vertices
;
79
81
Channel
channelType
;
82
84
mutable
vector<CFPair>
colourFlow
;
85
87
mutable
vector<CFPair>
largeNcColourFlow
;
88
90
vector<long>
ids
;
91
96
bool
sameDecay
(
const
TBDiagram
& x)
const
{
97
if
(
ids
[0] != x.
ids
[0])
return
false
;
98
bool
used[4]={
false
,
false
,
false
,
false
};
99
for
(
unsigned
int
ix=1;ix<4;++ix) {
100
bool
found=
false
;
101
for
(
unsigned
int
iy=1;iy<4;++iy) {
102
if
(used[iy])
continue
;
103
if
(
ids
[ix]==x.
ids
[iy]) {
104
used[iy]=
true
;
105
found=
true
;
106
break
;
107
}
108
}
109
if
(!found)
return
false
;
110
}
111
return
true
;
112
}
113
115
TBDiagram
(
const
NBDiagram
& diagram)
116
:
channelType
(UNDEFINED),
117
colourFlow
(diagram.
colourFlow
),
118
largeNcColourFlow
(diagram.
largeNcColourFlow
),
ids
(4,0) {
119
incoming
= diagram.
incoming
->id();
120
if
(diagram.
vertices
.size()==2) {
121
const
NBVertex
& child = (++diagram.
vertices
.begin())->second;
122
outgoing
= diagram.
vertices
.begin()->first->id();
123
unsigned
int
iloc=0;
124
for
(OrderedParticles::const_iterator it = child.
outgoing
.begin();
125
it!=child.
outgoing
.end();++it) {
126
if
(iloc==0)
outgoingPair
.first = (**it).id();
127
else
if
(iloc==1)
outgoingPair
.second = (**it).id();
128
++iloc;
129
}
130
intermediate
= child.
incoming
;
131
vertices
.second = child.
vertex
;
132
}
133
else
{
134
unsigned
int
iloc=0;
135
for
(OrderedParticles::const_iterator it = diagram.
outgoing
.begin();
136
it!=diagram.
outgoing
.end();++it) {
137
if
(iloc==0)
outgoing
= (**it).id();
138
else
if
(iloc==1)
outgoingPair
.first = (**it).id();
139
else
if
(iloc==2)
outgoingPair
.second = (**it).id();
140
++iloc;
141
}
142
}
143
vertices
.first = diagram.
vertex
;
144
ids
[0] =
incoming
;
145
ids
[1] =
outgoing
;
146
ids
[2] =
outgoingPair
.first;
147
ids
[3] =
outgoingPair
.second;
148
}
149
150
};
151
155
inline
bool
operator==
(
const
TBDiagram
& x,
const
TBDiagram
& y) {
156
if
( x.
incoming
!= y.
incoming
)
return
false
;
157
if
( x.
outgoing
!= y.
outgoing
)
return
false
;
158
if
( x.
intermediate
!= y.
intermediate
)
return
false
;
159
if
( x.
vertices
!= y.
vertices
)
return
false
;
160
if
( (x.
outgoingPair
.first == y.
outgoingPair
.first &&
161
x.
outgoingPair
.second == y.
outgoingPair
.second ) ||
162
(x.
outgoingPair
.first == y.
outgoingPair
.second &&
163
x.
outgoingPair
.second == y.
outgoingPair
.first ) )
return
true
;
164
else
return
false
;
165
}
166
170
inline
ostream &
operator<<
(ostream & os,
const
TBDiagram
& diag) {
171
os << diag.
incoming
<<
" -> "
;
172
os << diag.
outgoing
<<
" + ( "
;
173
if
(diag.
intermediate
) os << diag.
intermediate
->id();
174
os <<
" ) -> "
;
175
os << diag.
outgoingPair
.first <<
" "
<< diag.
outgoingPair
.second
176
<<
" channel: "
<< diag.
channelType
<<
" "
;
177
for
(
size_t
cf = 0; cf < diag.
colourFlow
.size(); ++cf)
178
os <<
"("
<< diag.
colourFlow
[cf].first <<
","
179
<<diag.
colourFlow
[cf].second <<
")"
;
180
os <<
'\n'
;
181
return
os;
182
}
183
189
inline
PersistentOStream
&
operator<<
(
PersistentOStream
& os,
190
const
TBDiagram
& x) {
191
os << x.
incoming
<< x.
outgoing
<< x.
outgoingPair
<< x.
intermediate
192
<< x.
vertices
<<
oenum
(x.
channelType
) << x.
colourFlow
193
<< x.
largeNcColourFlow
<< x.
ids
;
194
return
os;
195
}
196
202
inline
PersistentIStream
&
operator>>
(
PersistentIStream
& is,
203
TBDiagram
& x) {
204
is >> x.
incoming
>> x.
outgoing
>> x.
outgoingPair
>> x.
intermediate
205
>> x.
vertices
>>
ienum
(x.
channelType
) >> x.
colourFlow
206
>> x.
largeNcColourFlow
>> x.
ids
;
207
return
is;
208
}
209
210
}
211
212
#endif
/* HERWIG_TBDiagram_H */
ThePEG::PersistentIStream
ThePEG::PersistentOStream
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
Herwig::BPair
pair< bool, bool > BPair
Pair of bool's.
Definition:
HPDiagram.h:27
Herwig::CFPair
pair< unsigned int, double > CFPair
Pair of int,double.
Definition:
HPDiagram.h:36
Herwig::IDPair
pair< long, long > IDPair
Pair of particle ids.
Definition:
HPDiagram.h:24
Herwig::VBPtr
VertexBasePtr VBPtr
Convenient typedef of VertexBasePtr.
Definition:
HPDiagram.h:30
Herwig::VBPair
pair< VBPtr, VBPtr > VBPair
Pair of VertexBasePtrs.
Definition:
HPDiagram.h:33
ThePEG
ThePEG::operator>>
PersistentIStream & operator>>(PersistentIStream &is, HandlerGroup< HDLR > &hg)
ThePEG::operator==
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
ThePEG::ienum
IEnum< T > ienum(T &t)
ThePEG::oenum
OEnum< T > oenum(const T &t)
ThePEG::PDPtr
ThePEG::Ptr< ParticleData >::pointer PDPtr
ThePEG::operator<<
ostream & operator<<(ostream &, const Collision &)
Herwig::NBDiagram
The NBDiagram struct contains information about a decay that has been automatically generated.
Definition:
PrototypeVertex.h:360
Herwig::NBVertex
A simple vertex for the N-body diagram.
Definition:
PrototypeVertex.h:328
Herwig::NBVertex::outgoing
OrderedParticles outgoing
Outgoing particles.
Definition:
PrototypeVertex.h:343
Herwig::NBVertex::vertex
VertexBasePtr vertex
The vertex.
Definition:
PrototypeVertex.h:353
Herwig::NBVertex::incoming
tPDPtr incoming
Incoming particle.
Definition:
PrototypeVertex.h:338
Herwig::NBVertex::vertices
list< pair< PDPtr, NBVertex > > vertices
The vertices.
Definition:
PrototypeVertex.h:348
Herwig::TBDiagram
The TBDiagram struct contains information about a decay that has been automatically generated by Thr...
Definition:
TBDiagram.h:44
Herwig::TBDiagram::TBDiagram
TBDiagram()
Standard Constructor.
Definition:
TBDiagram.h:50
Herwig::TBDiagram::sameDecay
bool sameDecay(const TBDiagram &x) const
Test whether this and x are the same decay.
Definition:
TBDiagram.h:96
Herwig::TBDiagram::TBDiagram
TBDiagram(const NBDiagram &diagram)
Constructor from NBDiagram.
Definition:
TBDiagram.h:115
Herwig::TBDiagram::outgoing
long outgoing
Outgoing particle from first vertex.
Definition:
TBDiagram.h:69
Herwig::TBDiagram::outgoingPair
IDPair outgoingPair
Outgoing particle id's fropm resonance.
Definition:
TBDiagram.h:72
Herwig::TBDiagram::TBDiagram
TBDiagram(long a, long b, IDPair c)
Constructor taking ids as arguments.
Definition:
TBDiagram.h:56
Herwig::TBDiagram::channelType
Channel channelType
Enum of channel type.
Definition:
TBDiagram.h:81
Herwig::TBDiagram::vertices
VBPair vertices
The two vertices for the diagram.
Definition:
TBDiagram.h:78
Herwig::TBDiagram::largeNcColourFlow
vector< CFPair > largeNcColourFlow
Store colour flow at information.
Definition:
TBDiagram.h:87
Herwig::TBDiagram::Channel
Channel
Enumeration for channel type.
Definition:
TBDiagram.h:47
Herwig::TBDiagram::incoming
long incoming
Incoming particle id's.
Definition:
TBDiagram.h:66
Herwig::TBDiagram::ids
vector< long > ids
Store the ids in a vector for easy use of comparison operator.
Definition:
TBDiagram.h:90
Herwig::TBDiagram::colourFlow
vector< CFPair > colourFlow
Store colour flow at information.
Definition:
TBDiagram.h:84
Herwig::TBDiagram::intermediate
PDPtr intermediate
ParticleData pointer to intermediate, null for 4-point vertices.
Definition:
TBDiagram.h:75
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6