herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
GoSamAmplitude.h
1// -*- C++ -*-
2//
3// GoSamAmplitude.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4// Copyright (C) 2002-2019 The Herwig Collaboration
5//
6// Herwig 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 Herwig_GoSamAmplitude_H
10#define Herwig_GoSamAmplitude_H
11//
12// This is the declaration of the GoSamAmplitude class.
13//
14
15#include "Herwig/MatrixElement/Matchbox/Base/MatchboxOLPME.h"
16#include "ThePEG/Utilities/DynamicLoader.h"
17
18
19namespace Herwig {
20
21using namespace ThePEG;
22
23
25
26 public:
27 gosamprocinfo(){};
28 gosamprocinfo(int HID,int GID, string procstr,string typestr):
29 theHOlpId(HID),theGOlpId(GID),theProcstr(procstr),theTypestr(typestr){
30 }
32 int HID() const {return theHOlpId;}
33 int GID() const {return theGOlpId;}
34 string Pstr() const {return theProcstr;}
35 string Tstr() const {return theTypestr;}
36 void setGID(int g){theGOlpId=g;}
37 void setOAs(int i){ orderAlphas=i;}
38 int orderAs(){return orderAlphas;}
39 void setOAew(int j){ orderAlphaew=j;}
40 int orderAew(){return orderAlphaew;}
41 private:
42 int theHOlpId;
43 int theGOlpId;
44 string theProcstr;
45 string theTypestr;
46 int orderAlphas;
47 int orderAlphaew;
48 public:
49 void persistentOutput(PersistentOStream & os) const{os<<theHOlpId<<theGOlpId<<theProcstr<<theTypestr<<orderAlphas<<orderAlphaew;}
50 void persistentInput(PersistentIStream &is) {is>>theHOlpId>>theGOlpId>>theProcstr>>theTypestr>>orderAlphas>>orderAlphaew;}
51};
52
53
61
62public:
63
68
69public:
70
71 virtual void fillOrderFile(const map<pair<Process,int>,int>& procs, string OrderFileName);
72
73 virtual bool isCS() const { return false; }
74 virtual bool isExpanded() const { return true; }
75 virtual bool isBDK() const { return false; }
76 virtual bool isDR() const { return isitDR; }
77 virtual bool isDRbar() const {return false;}
78
83 virtual void signOLP(const string&, const string&);
84
85 virtual bool checkOLPContract(string contractFileName);
86
91 // virtual bool hasFinalStateSymmetry() const { return true; }
92 virtual bool hasFinalStateSymmetry() const { return false; }
93
94 virtual bool buildGoSam();
95
99 virtual void startOLP(const string&, int& status);
100
106 // virtual Energy2 mu2() const { return lastSHat(); }
107
112 virtual bool startOLP(const map<pair<Process,int>,int>& procs);
113
117 void evalSubProcess() const;
118
122 virtual void evalColourCorrelator(pair<int,int> ij) const;
123
129 virtual LorentzVector<Complex> plusPolarization(const Lorentz5Momentum& p,
130 const Lorentz5Momentum& n, int inc) const;
131
135 virtual void evalSpinColourCorrelator(pair<int,int> ij) const;
136
137 void getids() const;
138
139 int accuracyTargetNegExp() const { return theAccuracyTarget; }
140
141public:
142
145
151
157 void persistentInput(PersistentIStream & is, int version);
158
160
167 static void Init();
168
169
170protected:
171
174
180 virtual void doinit();
181
186 virtual void doinitrun();
188
189
190protected:
191
194
199 virtual IBPtr clone() const;
200
205 virtual IBPtr fullclone() const;
206
208
209
210// If needed, insert declarations of virtual function defined in the
211// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
212
213
214private:
215
221
225 mutable vector<double> colourCorrelatorResults;
226
230 mutable vector<double> spinColourCorrelatorResults;
231
235 mutable vector<int> idpair;
236
240 mutable vector<string> idtypepair;
241
245 map<int , gosamprocinfo > processmap;
246
247 mutable string gosamPathInterface;
248 mutable string gosamSetupInFileNameInterface;
249 mutable string gosamBuildScript;
250
251 mutable string gosamPath;
252 mutable string gosamSourcePath;
253 mutable string gosamInstallPath;
254
255 mutable string gosamSetupInFileName;
256
257 mutable string orderFileTitle;
258 mutable string contractFileTitle;
259 mutable string contractFileName;
260 mutable string orderFileName;
261
262 mutable string accuracyFileTitle;
263 mutable string accuracyFile;
264 int theAccuracyTarget;
265
266 bool theCodeExists;
267 bool theFormOpt;
268 bool theNinja;
269 bool theHiggsEff;
270 bool theMassiveLeptons;
271
272 int theLoopInducedOption;
273
274 bool isitDR;
275
276 mutable bool doneGoSamInit;
277 mutable bool doneGoSamInitRun;
278
282 vector<int> massiveParticles; //theMassiveParticles;
283
287 void setupGoSamIn(string setupGoSamInFile);
288
289protected:
290
294 string bindir_;
295
300
305
306}; // end "class GoSamAmplitude: public MatchboxOLPME"
307
309 p.persistentOutput(os); return os;
310 }
311
312 inline PersistentIStream& operator>>(PersistentIStream& is, gosamprocinfo& p) {
313 p.persistentInput(is); return is;
314 }
315
316} // end "namespace Herwig"
317
318#endif /* Herwig_GoSamAmplitude_H */
GoSamAmplitude implements an interface to GoSam.
string GoSamPrefix_
Location of GOSAM.
virtual IBPtr clone() const
Make a simple clone of this object.
vector< int > idpair
first is the olp id from herwig, second the answer from gosam
map< int, gosamprocinfo > processmap
Map to store all processes handled by this Amplitude.
vector< string > idtypepair
first is the olp id from herwig, second the amplitude type
virtual void signOLP(const string &, const string &)
Start the one loop provider, if appropriate, giving order and contract files.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual bool isDR() const
Return true, if one loop corrections have been calculated in dimensional reduction.
vector< double > spinColourCorrelatorResults
Store spin colour correlator results.
static void Init()
The standard Init function used to initialize the interfaces.
virtual bool hasFinalStateSymmetry() const
Return true, if this amplitude already includes symmetry factors for identical outgoing particles.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
virtual bool startOLP(const map< pair< Process, int >, int > &procs)
Return the value of the dimensional regularization parameter.
GoSamAmplitude()
The default constructor.
virtual void evalColourCorrelator(pair< int, int > ij) const
Fill in results for the given colour correlator.
void setupGoSamIn(string setupGoSamInFile)
Method to create the setup.in file for GoSam.
virtual bool isDRbar() const
Return true, if the amplitude is DRbar renormalized, otherwise MSbar is assumed.
GoSamAmplitude & operator=(const GoSamAmplitude &)=delete
The assignment operator is private and must never be called.
void evalSubProcess() const
Call OLP_EvalSubProcess and fill in the results.
string pkgdatadir_
Location of the data files.
virtual bool isExpanded() const
Return true, if one loop corrections are given in the conventions of everything expanded.
virtual void evalSpinColourCorrelator(pair< int, int > ij) const
Fill in results for the given colour/spin correlator.
virtual bool isBDK() const
Return true, if one loop corrections are given in the conventions of BDK.
virtual void startOLP(const string &, int &status)
Start the one loop provider, if appropriate.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
virtual void doinitrun()
Initialize this object.
string bindir_
Location of the installed executables.
virtual bool isCS() const
Return true, if one loop corrections are given in the conventions of the integrated dipoles.
vector< int > massiveParticles
The PDG codes of those quarks with mass.
virtual LorentzVector< Complex > plusPolarization(const Lorentz5Momentum &p, const Lorentz5Momentum &n, int inc) const
Return a positive helicity polarization vector for a gluon of momentum p (with reference vector n) to...
vector< double > colourCorrelatorResults
Store colour correlator results.
MatchboxOLPME implements OLP interfaces.
Definition: MatchboxOLPME.h:27
-*- C++ -*-
PersistentIStream & operator>>(PersistentIStream &is, HandlerGroup< HDLR > &hg)
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ostream & operator<<(ostream &, const Collision &)