herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
HardProcessConstructor.h
1// -*- C++ -*-
2#ifndef HERWIG_HardProcessConstructor_H
3#define HERWIG_HardProcessConstructor_H
4//
5// This is the declaration of the HardProcessConstructor class.
6//
7
8#include "ThePEG/Interface/Interfaced.h"
9#include "HPDiagram.h"
10#include "Herwig/Models/StandardModel/StandardModel.h"
11#include "ThePEG/Handlers/SubProcessHandler.h"
12#include "ThePEG/Repository/EventGenerator.h"
13#include "ThePEG/Handlers/StandardEventHandler.h"
14#include "Herwig/MatrixElement/General/GeneralHardME.h"
15#include "HardProcessConstructor.fh"
16
17namespace Herwig {
18
19using namespace ThePEG;
20
28
29public:
30
32 typedef vector<HPDiagram> HPDVector;
33
34public:
35
43
47 virtual void constructDiagrams() = 0;
48
49public:
50
58
64 void persistentInput(PersistentIStream & is, int version);
66
73 static void Init();
74
75protected:
76
84 void fixFSOrder(HPDiagram & diag);
85
90 void assignToCF(HPDiagram & diag);
91
96 void sChannelCF(HPDiagram & diag);
97
102 void tChannelCF(HPDiagram & diag);
103
108 void uChannelCF(HPDiagram & diag);
109
114 void fourPointCF(HPDiagram & diag);
116
120 tHwSMPtr model() const {return model_;}
121
125 tSubHdlPtr subProcess() const {return subProcess_;}
126
132 bool debug() const {return debug_;}
133
139
145 bool duplicate(const HPDiagram & diagram,
146 const HPDVector & group) const;
147
151 bool checkOrder(const HPDiagram & diag) const;
152
153protected:
154
162 virtual void doinit();
164
165private:
166
172
173private:
174
178 tHwSMPtr model_;
179
183 tSubHdlPtr subProcess_;
184
190 bool debug_;
191
192};
193
194namespace HPC_helper {
195 // Helper functor for find_if in duplicate function.
197 public:
198 SameIncomingAs(tPDPair in) : a(in.first->id()), b(in.second->id()) {}
199 bool operator()(tPDPair ppair) const {
200 long id1(ppair.first->id()), id2(ppair.second->id());
201 return ( id1 == a && id2 == b ) || ( id1 == b && id2 == a );
202 }
203 private:
204 long a, b;
205 };
206
207 inline bool duplicateIncoming(tPDPair ppair,const vector<tPDPair> &incPairs) {
208 vector<tPDPair>::const_iterator it =
209 find_if( incPairs.begin(), incPairs.end(), SameIncomingAs(ppair) );
210 return it != incPairs.end();
211 }
212}
213
214}
215
216#endif /* HERWIG_HardProcessConstructor_H */
ColourStructure
Enum for the possible colour structures.
Definition: GeneralHardME.h:52
Here is the documentation of the HardProcessConstructor class.
vector< HPDiagram > HPDVector
Vector of HPDiagrams.
void assignToCF(HPDiagram &diag)
Assign a diagram to the appropriate colour flow(s).
GeneralHardME::ColourStructure colourFlow(const tcPDVector &extpart) const
Get the correct colour factor matrix.
HardProcessConstructor()
The default constructor.
virtual void constructDiagrams()=0
The main function to create diagrams etc for the processes.
void sChannelCF(HPDiagram &diag)
Assign a $s$-channel diagram to the appropriate colour flow(s).
tHwSMPtr model() const
Pointer to the model being used.
tSubHdlPtr subProcess_
Pointer to the sub process handler.
bool debug_
Whether to print the debug information with the matrix element.
HardProcessConstructor & operator=(const HardProcessConstructor &)=delete
The assignment operator is private and must never be called.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void fourPointCF(HPDiagram &diag)
Assign a $u$-channel diagram to the appropriate colour flow(s).
void fixFSOrder(HPDiagram &diag)
Functions to set up colour flows and matrix elements.
bool checkOrder(const HPDiagram &diag) const
check the order of a diagram
tSubHdlPtr subProcess() const
Pointer to the sub process handler.
bool duplicate(const HPDiagram &diagram, const HPDVector &group) const
Search for a diagram that has already been created.
void tChannelCF(HPDiagram &diag)
Assign a $t$-channel diagram to the appropriate colour flow(s).
bool debug() const
Whether to print the debug information with the matrix element.
tHwSMPtr model_
Pointer to the model being used.
void uChannelCF(HPDiagram &diag)
Assign a $u$-channel diagram to the appropriate colour flow(s).
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
static void Init()
The standard Init function used to initialize the interfaces.
-*- C++ -*-
pair< tPDPtr, tPDPtr > tPDPair
Iterator find_if(IteratorRange< Iterator > r, Pred p)
vector< tcPDPtr > tcPDVector
The HPDiagram struct contains information about a 2->2 hard-process that has been automatically gener...
Definition: HPDiagram.h:42