thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
EventRecord
ColourBase.h
1
// -*- C++ -*-
2
//
3
// ColourBase.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_ColourBase_H
10
#define ThePEG_ColourBase_H
11
// This is the declaration of the ColourBase class.
12
13
#include "ThePEG/EventRecord/EventInfoBase.h"
14
#include "ThePEG/EventRecord/ColourLine.h"
15
16
namespace
ThePEG
{
17
32
class
ColourBase
:
public
EventInfoBase
{
33
34
public
:
35
37
friend
class
ColourLine
;
38
39
public
:
40
44
tColinePtr
antiColourLine
()
const
{
return
theAntiColourLine
; }
45
49
tColinePtr
colourLine
()
const
{
return
theColourLine
; }
50
55
virtual
vector<tcColinePtr>
antiColourLines
()
const
;
56
61
virtual
vector<tcColinePtr>
colourLines
()
const
;
62
67
virtual
bool
hasColourLine
(
tcColinePtr
line,
bool
anti =
false
)
const
;
68
73
bool
hasAntiColourLine
(
tcColinePtr
line)
const
{
74
return
hasColourLine
(line,
true
);
75
}
76
77
protected
:
78
82
virtual
void
antiColourLine
(
tColinePtr
line) {
83
theAntiColourLine
= line;
84
}
85
89
virtual
void
colourLine
(
tColinePtr
l,
bool
anti =
false
) {
90
if
( anti )
antiColourLine
(l);
91
else
theColourLine
= l;
92
}
93
97
virtual
void
removeAntiColourLine
(
tcColinePtr
line) {
98
if
(
antiColourLine
() == line )
theAntiColourLine
=
tColinePtr
();
99
}
100
104
virtual
void
removeColourLine
(
tcColinePtr
line,
bool
anti =
false
) {
105
if
( anti )
removeAntiColourLine
(line);
106
else
if
(
colourLine
() == line )
theColourLine
=
tColinePtr
();
107
}
108
109
public
:
110
118
virtual
void
rebind
(
const
EventTranslationMap
& trans);
119
123
void
persistentOutput
(
PersistentOStream
&)
const
;
124
128
void
persistentInput
(
PersistentIStream
&,
int
);
129
133
static
void
Init
();
134
138
virtual
EIPtr
clone
()
const
;
139
140
private
:
141
145
ColinePtr
theAntiColourLine
;
146
150
ColinePtr
theColourLine
;
151
152
private
:
153
157
static
ClassDescription<ColourBase>
initColourBase
;
158
162
ColourBase
&
operator=
(
const
ColourBase
&) =
delete
;
163
164
};
165
166
168
ThePEG_DECLARE_CLASS_TRAITS(
ColourBase
,
EventInfoBase
);
171
}
172
173
#endif
/* ThePEG_ColourBase_H */
ThePEG::ClassDescription
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
Definition:
ClassDescription.h:333
ThePEG::ColourBase
ColourBase is the base class to be used to supply a Particle with information about its colour state.
Definition:
ColourBase.h:32
ThePEG::ColourBase::initColourBase
static ClassDescription< ColourBase > initColourBase
Describe concrete class with persistent data.
Definition:
ColourBase.h:157
ThePEG::ColourBase::persistentInput
void persistentInput(PersistentIStream &, int)
Standard functions for reading from a persistent stream.
ThePEG::ColourBase::colourLine
tColinePtr colourLine() const
Return the colour line to which this particle is connected.
Definition:
ColourBase.h:49
ThePEG::ColourBase::antiColourLines
virtual vector< tcColinePtr > antiColourLines() const
Return the anti-colour lines to which this particle is connected.
ThePEG::ColourBase::removeAntiColourLine
virtual void removeAntiColourLine(tcColinePtr line)
Remove the anti-colour line to which this particle is connected.
Definition:
ColourBase.h:97
ThePEG::ColourBase::rebind
virtual void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
ThePEG::ColourBase::hasAntiColourLine
bool hasAntiColourLine(tcColinePtr line) const
Return true if the particle is connected to the given anti-colour line.
Definition:
ColourBase.h:73
ThePEG::ColourBase::theAntiColourLine
ColinePtr theAntiColourLine
The anti-colour line to which this particle is connected.
Definition:
ColourBase.h:145
ThePEG::ColourBase::Init
static void Init()
Standard Init function.
ThePEG::ColourBase::antiColourLine
virtual void antiColourLine(tColinePtr line)
Set the anti-colour line to which this particle is connected.
Definition:
ColourBase.h:82
ThePEG::ColourBase::removeColourLine
virtual void removeColourLine(tcColinePtr line, bool anti=false)
Remove the (anti-) colour line to which this particle is connected.
Definition:
ColourBase.h:104
ThePEG::ColourBase::operator=
ColourBase & operator=(const ColourBase &)=delete
Private and non-existent assignment operator.
ThePEG::ColourBase::persistentOutput
void persistentOutput(PersistentOStream &) const
Standard function for writing to a persistent stream.
ThePEG::ColourBase::hasColourLine
virtual bool hasColourLine(tcColinePtr line, bool anti=false) const
Return true if the particle is connected to the given (anti-) colour line.
ThePEG::ColourBase::theColourLine
ColinePtr theColourLine
The colour line to which this particle is connected.
Definition:
ColourBase.h:150
ThePEG::ColourBase::antiColourLine
tColinePtr antiColourLine() const
Return the anti-colour line to which this particle is connected.
Definition:
ColourBase.h:44
ThePEG::ColourBase::colourLine
virtual void colourLine(tColinePtr l, bool anti=false)
Set the (anti-) colour line to which this particle is connected.
Definition:
ColourBase.h:89
ThePEG::ColourBase::colourLines
virtual vector< tcColinePtr > colourLines() const
Return the colour lines to which this particle is connected.
ThePEG::ColourBase::clone
virtual EIPtr clone() const
Standard clone method.
ThePEG::ColourLine
The ColourLine class represents colour lines connecting Particles.
Definition:
ColourLine.h:36
ThePEG::EventInfoBase
EventInfoBase is a base class for information objects.
Definition:
EventInfoBase.h:27
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::Rebinder
Rebinder is a class associating pairs of pointers to objects.
Definition:
Rebinder.h:27
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::tColinePtr
ThePEG::Ptr< ColourLine >::transient_pointer tColinePtr
Alias for a transient pointer to ColourLine .
Definition:
Pointers.h:96
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6