herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
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 
17 namespace Herwig {
18 
19 using namespace ThePEG;
20 
28 
29 public:
30 
32  typedef vector<HPDiagram> HPDVector;
33 
34 public:
35 
41  HardProcessConstructor() : debug_(false) {}
43 
47  virtual void constructDiagrams() = 0;
48 
49 public:
50 
57  void persistentOutput(PersistentOStream & os) const;
58 
64  void persistentInput(PersistentIStream & is, int version);
66 
73  static void Init();
74 
75 protected:
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 
138  GeneralHardME::ColourStructure colourFlow(const tcPDVector & extpart) const;
139 
145  bool duplicate(const HPDiagram & diagram,
146  const HPDVector & group) const;
147 
151  bool checkOrder(const HPDiagram & diag) const;
152 
153 protected:
154 
162  virtual void doinit();
164 
165 private:
166 
171  HardProcessConstructor & operator=(const HardProcessConstructor &) = delete;
172 
173 private:
174 
178  tHwSMPtr model_;
179 
183  tSubHdlPtr subProcess_;
184 
190  bool debug_;
191 
192 };
193 
194 namespace 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 */
tHwSMPtr model() const
Pointer to the model being used.
ColourStructure
Enum for the possible colour structures.
Definition: GeneralHardME.h:52
bool debug() const
Whether to print the debug information with the matrix element.
vector< tcPDPtr > tcPDVector
tHwSMPtr model_
Pointer to the model being used.
HardProcessConstructor()
The default constructor.
Iterator find_if(IteratorRange< Iterator > r, Pred p)
tSubHdlPtr subProcess() const
Pointer to the sub process handler.
tSubHdlPtr subProcess_
Pointer to the sub process handler.
vector< HPDiagram > HPDVector
Vector of HPDiagrams.
pair< tPDPtr, tPDPtr > tPDPair
-*- C++ -*-
The HPDiagram struct contains information about a 2->2 hard-process that has been automatically gener...
Definition: HPDiagram.h:42
bool debug_
Whether to print the debug information with the matrix element.
Here is the documentation of the HardProcessConstructor class.