thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
DiagramBase.h
1// -*- C++ -*-
2//
3// DiagramBase.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_DiagramBase_H
10#define ThePEG_DiagramBase_H
11// This is the declaration of the DiagramBase class.
12
14#include "ThePEG/PDT/ParticleData.h"
15#include "ThePEG/MatrixElement/ColourLines.h"
16#include "ThePEG/Handlers/StandardXComb.fh"
17#include "DiagramBase.fh"
18#include "DiagramBase.xh"
19
20namespace ThePEG {
21
41class DiagramBase: public Base {
42
43public:
44
51
55 virtual ~DiagramBase();
57
58public:
59
70 const ColourLines &) const = 0;
72
79 int nIncoming() const { return theNIncoming; }
80
85 const cPDVector& partons() const { return thePartons; }
86
90 int id() const { return theId; }
91
96 string getTag() const;
97
102 virtual bool isSame (tcDiagPtr other) const {
103 return
104 nIncoming() == other->nIncoming() &&
105 partons() == other->partons();
106 }
108
109protected:
110
123 void partons(int ninc, const cPDVector & parts, int newId) {
124 theNIncoming = ninc;
125 thePartons = parts;
126 theId = newId;
127 }
128
133 void diagramInfo(int ninc, int newId) {
134 theNIncoming = ninc;
135 theId = newId;
136 }
137
142 bool done() const { return nIncoming() >= 0; }
143
147 void addParton(tcPDPtr pd) { thePartons.push_back(pd); }
148
149public:
150
158
164 void persistentInput(PersistentIStream & is, int version);
166
170 static void Init();
171
172private:
173
178
184
188 int theId;
189
190private:
191
196
200 DiagramBase & operator=(const DiagramBase &) = delete;
201
202};
203
204}
205
206
207namespace ThePEG {
208
215template <>
216struct BaseClassTrait<DiagramBase,1>: public ClassTraitsType {
218 typedef Base NthBase;
219};
220
225template <>
226struct ClassTraits<DiagramBase>: public ClassTraitsBase<DiagramBase> {
228 static string className() { return "ThePEG::DiagramBase"; }
229};
230
233}
234
235#endif /* ThePEG_DiagramBase_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing an abstract class with persistent data.
The ColourLines class defines the colour flow in a SubProcess.
Definition: ColourLines.h:23
DiagramBase is the base class of all classes which describes Feynman diagrams which can be generated ...
Definition: DiagramBase.h:41
int nIncoming() const
Return the number of incoming partons for this diagram.
Definition: DiagramBase.h:79
void addParton(tcPDPtr pd)
Add to the partons.
Definition: DiagramBase.h:147
int theNIncoming
The number of incoming partons for this diagram.
Definition: DiagramBase.h:177
virtual ~DiagramBase()
Destructor.
virtual bool isSame(tcDiagPtr other) const
Compare this diagram to another one modulo the ids of the diagrams.
Definition: DiagramBase.h:102
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void partons(int ninc, const cPDVector &parts, int newId)
To be used by sub classes to report the incoming and outgoing particle types, and an id number.
Definition: DiagramBase.h:123
string getTag() const
Generate a tag which is unique for diagrams with the same type of incoming and outgoing partons.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
int id() const
Return the id number of this diagram.
Definition: DiagramBase.h:90
void diagramInfo(int ninc, int newId)
Complete the missing information, provided partons() has already been filled.
Definition: DiagramBase.h:133
cPDVector thePartons
The incoming, followed by the outgoing partons for this diagram.
Definition: DiagramBase.h:183
int theId
The id number of this diagram.
Definition: DiagramBase.h:188
const cPDVector & partons() const
Return the incoming, followed by the outgoing partons for this diagram.
Definition: DiagramBase.h:85
static AbstractClassDescription< DiagramBase > initDiagramBase
Describe an abstract base class with persistent data.
Definition: DiagramBase.h:195
virtual tPVector construct(SubProPtr sb, const StandardXComb &, const ColourLines &) const =0
Construct a sub process corresponding to this diagram.
bool done() const
Returns true if the partons(int, const cPDVector &, int) function has been called properly from the s...
Definition: DiagramBase.h:142
static void Init()
Standard Init function.
DiagramBase()
Default constructor.
Definition: DiagramBase.h:50
DiagramBase & operator=(const DiagramBase &)=delete
Private and non-existent assignment operator.
PersistentIStream is used to read persistent objects from a stream where they were previously written...
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
The StandardXComb class inherits from the more general XComb class which stores all information about...
Definition: StandardXComb.h:53
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
vector< cPDPtr > cPDVector
A vector of pointers to const ParticleData objects.
Definition: Containers.h:36
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
Define the base class from which all (polymorphic) classes in ThePEG are derived.
Definition: ThePEG.h:54
static string className()
Return the name of class T.
Definition: ClassTraits.h:66