thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
EventRecord
ColourLine.h
1
// -*- C++ -*-
2
//
3
// ColourLine.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG 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 ThePEG_ColourLine_H
10
#define ThePEG_ColourLine_H
11
// This is the declaration of the ColourLine class.
12
13
#include "
EventConfig.h
"
14
#include "ThePEG/Utilities/ClassDescription.h"
15
#include "ThePEG/EventRecord/ColourSinglet.h"
16
17
namespace
ThePEG
{
18
36
class
ColourLine
:
public
EventRecordBase
{
37
38
public
:
39
46
static
tColinePtr
create
(
tPPtr
col,
tPPtr
anti);
47
55
static
tColinePtr
create
(
tPPtr
p,
bool
anti =
false
);
56
62
static
tColinePtr
createAnti
(
tPPtr
p) {
return
create
(p,
true
); }
63
70
static
tColinePtr
create
(
tColinePtr
son1,
tColinePtr
son2,
71
tColinePtr
sin1,
tColinePtr
sin2);
73
77
virtual
~ColourLine
();
78
79
public
:
80
87
const
tPVector
&
coloured
()
const
{
return
theColoured
; }
88
93
const
tPVector
&
antiColoured
()
const
{
return
theAntiColoured
; }
94
101
tPPtr
startParticle
()
const
;
102
108
tPPtr
endParticle
()
const
;
109
111
117
void
addAntiColoured
(
tPPtr
);
118
124
void
addColoured
(
tPPtr
p,
bool
anti =
false
);
125
129
void
addAntiColouredIndexed
(
tPPtr
p,
int
index);
130
136
void
addColouredIndexed
(
tPPtr
p,
int
index,
bool
anti=
false
);
137
141
void
removeAntiColoured
(
tPPtr
);
142
148
void
removeColoured
(
tPPtr
p,
bool
anti =
false
);
149
151
158
tColinePair
sinkNeighbours
()
const
{
return
theSinkNeighbours
; }
159
165
tColinePair
sourceNeighbours
(
bool
anti =
false
)
const
{
166
return
anti?
theSinkNeighbours
:
theSourceNeighbours
;
167
}
168
174
void
setSinkNeighbours
(
tColinePtr
l1,
tColinePtr
l2) {
175
theSinkNeighbours
.second = l1->theSinkNeighbours.second = l2;
176
l2->theSinkNeighbours.second =
theSinkNeighbours
.first = l1;
177
l1->theSinkNeighbours.first = l2->theSinkNeighbours.first =
this
;
178
}
179
185
void
setSourceNeighbours
(
tColinePtr
l1,
tColinePtr
l2) {
186
theSourceNeighbours
.second = l1->theSourceNeighbours.second = l2;
187
l2->theSourceNeighbours.second =
theSourceNeighbours
.first = l1;
188
l1->theSourceNeighbours.first = l2->theSourceNeighbours.first =
this
;
189
}
190
192
201
bool
join
(
ColinePtr
line);
202
207
template
<
typename
Iterator>
208
typename
std::iterator_traits<Iterator>::value_type
209
getColouredParticle
(Iterator first, Iterator last,
bool
anti =
false
)
const
{
210
typedef
typename
std::iterator_traits<Iterator>::value_type ParticlePointer;
211
for
( ; first != last; ++first )
212
if
( (**first).coloured() && (**first).hasColourLine(
this
, anti) )
213
return
*first;
214
return
ParticlePointer();
215
}
216
220
void
write
(ostream & os,
tcEventPtr
event,
bool
anti)
const
;
221
222
public
:
223
227
void
persistentOutput
(
PersistentOStream
&)
const
;
228
232
void
persistentInput
(
PersistentIStream
&,
int
);
233
234
private
:
235
240
tPVector
theColoured
;
241
246
tPVector
theAntiColoured
;
247
252
tColinePair
theSourceNeighbours
;
253
258
tColinePair
theSinkNeighbours
;
259
265
vector<ColinePtr>
orphanedConnectors
;
266
267
private
:
268
272
static
ClassDescription<ColourLine>
initColourLine
;
273
277
ColourLine
&
operator=
(
const
ColourLine
&) =
delete
;
278
279
};
280
281
}
282
283
284
namespace
ThePEG
{
285
292
template
<>
293
struct
BaseClassTrait<ColourLine,1>:
public
ClassTraitsType {
295
typedef
EventRecordBase
NthBase
;
296
};
297
302
template
<>
303
struct
ClassTraits<ColourLine>:
public
ClassTraitsBase<ColourLine> {
305
static
string
className
() {
return
"ThePEG::ColourLine"
; }
308
static
string
library
() {
return
"ColourLine.so"
; }
309
};
310
313
}
314
315
#endif
/* ThePEG_ColourLine_H */
EventConfig.h
This is the main config header file for the Event classes.
ThePEG::ClassDescription
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
Definition:
ClassDescription.h:333
ThePEG::ColourLine
The ColourLine class represents colour lines connecting Particles.
Definition:
ColourLine.h:36
ThePEG::ColourLine::addColoured
void addColoured(tPPtr p, bool anti=false)
Add a particle having this as a (anti-)colour line.
ThePEG::ColourLine::create
static tColinePtr create(tColinePtr son1, tColinePtr son2, tColinePtr sin1, tColinePtr sin2)
Create a coloue line which is a connector between two junctions, a source junction with neigboring co...
ThePEG::ColourLine::operator=
ColourLine & operator=(const ColourLine &)=delete
Private and non-existent assignment operator.
ThePEG::ColourLine::removeAntiColoured
void removeAntiColoured(tPPtr)
Remove a particle having this as an anti-colour line.
ThePEG::ColourLine::join
bool join(ColinePtr line)
Join with the given ColourLine.
ThePEG::ColourLine::theColoured
tPVector theColoured
The particles connecting to this colour line, following the incoming colour flow.
Definition:
ColourLine.h:240
ThePEG::ColourLine::initColourLine
static ClassDescription< ColourLine > initColourLine
Describe a concrete class with persistent data.
Definition:
ColourLine.h:272
ThePEG::ColourLine::getColouredParticle
std::iterator_traits< Iterator >::value_type getColouredParticle(Iterator first, Iterator last, bool anti=false) const
Return the first (anti-)coloured parton among the given range of particles which is on this colour li...
Definition:
ColourLine.h:209
ThePEG::ColourLine::antiColoured
const tPVector & antiColoured() const
Return the vectors of particles connected to this line with their anti-colours.
Definition:
ColourLine.h:93
ThePEG::ColourLine::createAnti
static tColinePtr createAnti(tPPtr p)
Create a colour line.
Definition:
ColourLine.h:62
ThePEG::ColourLine::write
void write(ostream &os, tcEventPtr event, bool anti) const
Write out information about this colour line to the stream.
ThePEG::ColourLine::setSourceNeighbours
void setSourceNeighbours(tColinePtr l1, tColinePtr l2)
Add two colour lines as neighbours to this line.
Definition:
ColourLine.h:185
ThePEG::ColourLine::setSinkNeighbours
void setSinkNeighbours(tColinePtr l1, tColinePtr l2)
Add two colour lines as neighbours to this line.
Definition:
ColourLine.h:174
ThePEG::ColourLine::addAntiColouredIndexed
void addAntiColouredIndexed(tPPtr p, int index)
Add a particle having this as a anti-colour line at a given index.
ThePEG::ColourLine::create
static tColinePtr create(tPPtr col, tPPtr anti)
Create a colour line.
ThePEG::ColourLine::orphanedConnectors
vector< ColinePtr > orphanedConnectors
Colour lines which are connectors between two junctions do not have a particle which owns it,...
Definition:
ColourLine.h:265
ThePEG::ColourLine::persistentOutput
void persistentOutput(PersistentOStream &) const
Standard function for writing to a persistent stream.
ThePEG::ColourLine::theAntiColoured
tPVector theAntiColoured
The particles connecting to this colour line, following the outgoing colour flow.
Definition:
ColourLine.h:246
ThePEG::ColourLine::addAntiColoured
void addAntiColoured(tPPtr)
Add a particle having this as a anti-colour line.
ThePEG::ColourLine::persistentInput
void persistentInput(PersistentIStream &, int)
Standard function for reading from a persistent stream.
ThePEG::ColourLine::sinkNeighbours
tColinePair sinkNeighbours() const
If this colour line ends in a colour sink, these two colour lines ends in the same.
Definition:
ColourLine.h:158
ThePEG::ColourLine::theSourceNeighbours
tColinePair theSourceNeighbours
If this colour line stems from a colour source, these two colour lines stems from the same.
Definition:
ColourLine.h:252
ThePEG::ColourLine::endParticle
tPPtr endParticle() const
Return the last particle on this colour line.
ThePEG::ColourLine::~ColourLine
virtual ~ColourLine()
Destructor.
ThePEG::ColourLine::addColouredIndexed
void addColouredIndexed(tPPtr p, int index, bool anti=false)
Add a particle having this as a (anti-)colour line at a given index.
ThePEG::ColourLine::theSinkNeighbours
tColinePair theSinkNeighbours
If this colour line ends in a colour sink, these two colour lines ends in the same.
Definition:
ColourLine.h:258
ThePEG::ColourLine::coloured
const tPVector & coloured() const
Return the vectors of particles connected to this line with their colours.
Definition:
ColourLine.h:87
ThePEG::ColourLine::sourceNeighbours
tColinePair sourceNeighbours(bool anti=false) const
If this colour line stems from a colour source (sink), these two colour lines stems from (ends in) th...
Definition:
ColourLine.h:165
ThePEG::ColourLine::create
static tColinePtr create(tPPtr p, bool anti=false)
Create a colour line.
ThePEG::ColourLine::removeColoured
void removeColoured(tPPtr p, bool anti=false)
Remove a particle having this as a (anti-)colour line.
ThePEG::ColourLine::startParticle
tPPtr startParticle() const
Return the first particle on this colour line.
ThePEG::PersistentIStream
PersistentIStream is used to read persistent objects from a stream where they were previously written...
Definition:
PersistentIStream.h:48
ThePEG::PersistentOStream
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
Definition:
PersistentOStream.h:51
ThePEG::Pointer::RCPtr
RCPtr is a reference counted (smart) pointer.
Definition:
RCPtr.h:60
ThePEG::Pointer::TransientConstRCPtr
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition:
RCPtr.h:696
ThePEG::Pointer::TransientRCPtr
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition:
RCPtr.h:519
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::tPVector
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition:
Containers.h:82
ThePEG::EventRecordBase
Base EventRecordBase
EventRecordBase is the base class of all event record classes.
Definition:
EventConfig.h:41
ThePEG::tColinePair
pair< tColinePtr, tColinePtr > tColinePair
A pair of transient pointers to ColourLine objects.
Definition:
Containers.h:148
ThePEG::BaseClassTrait::NthBase
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition:
ClassTraits.h:161
ThePEG::Base
Define the base class from which all (polymorphic) classes in ThePEG are derived.
Definition:
ThePEG.h:54
ThePEG::ClassTraitsBase::className
static string className()
Return the name of class T.
Definition:
ClassTraits.h:66
ThePEG::ClassTraitsBase::library
static string library()
The name of a file containing the dynamic library where the class T is implemented.
Definition:
ClassTraits.h:85
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6