herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
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 
19 namespace Herwig {
20 
21 using 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  }
31  ~gosamprocinfo(){}
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 
62 public:
63 
66 
71 
75  virtual ~GoSamAmplitude();
76 
78 
79 
80 public:
81 
82  virtual void fillOrderFile(const map<pair<Process,int>,int>& procs, string OrderFileName);
83 
84  virtual bool isCS() const { return false; }
85  virtual bool isExpanded() const { return true; }
86  virtual bool isBDK() const { return false; }
87  virtual bool isDR() const { return isitDR; }
88  virtual bool isDRbar() const {return false;}
89 
94  virtual void signOLP(const string&, const string&);
95 
96  virtual bool checkOLPContract(string contractFileName);
97 
102  // virtual bool hasFinalStateSymmetry() const { return true; }
103  virtual bool hasFinalStateSymmetry() const { return false; }
104 
105  virtual bool buildGoSam();
106 
110  virtual void startOLP(const string&, int& status);
111 
117  // virtual Energy2 mu2() const { return lastSHat(); }
118 
123  virtual bool startOLP(const map<pair<Process,int>,int>& procs);
124 
128  void evalSubProcess() const;
129 
133  virtual void evalColourCorrelator(pair<int,int> ij) const;
134 
140  virtual LorentzVector<Complex> plusPolarization(const Lorentz5Momentum& p,
141  const Lorentz5Momentum& n, int inc) const;
142 
146  virtual void evalSpinColourCorrelator(pair<int,int> ij) const;
147 
148  void getids() const;
149 
150  int accuracyTargetNegExp() const { return theAccuracyTarget; }
151 
152 public:
153 
156 
161  void persistentOutput(PersistentOStream & os) const;
162 
168  void persistentInput(PersistentIStream & is, int version);
169 
171 
178  static void Init();
179 
180 
181 protected:
182 
185 
191  virtual void doinit();
192 
197  virtual void doinitrun();
199 
200 
201 protected:
202 
205 
210  virtual IBPtr clone() const;
211 
216  virtual IBPtr fullclone() const;
217 
219 
220 
221 // If needed, insert declarations of virtual function defined in the
222 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
223 
224 
225 private:
226 
231  GoSamAmplitude & operator=(const GoSamAmplitude &) = delete;
232 
236  mutable vector<double> colourCorrelatorResults;
237 
241  mutable vector<double> spinColourCorrelatorResults;
242 
246  mutable vector<int> idpair;
247 
251  mutable vector<string> idtypepair;
252 
256  map<int , gosamprocinfo > processmap;
257 
258  mutable string gosamPathInterface;
259  mutable string gosamSetupInFileNameInterface;
260  mutable string gosamBuildScript;
261 
262  mutable string gosamPath;
263  mutable string gosamSourcePath;
264  mutable string gosamInstallPath;
265 
266  mutable string gosamSetupInFileName;
267 
268  mutable string orderFileTitle;
269  mutable string contractFileTitle;
270  mutable string contractFileName;
271  mutable string orderFileName;
272 
273  mutable string accuracyFileTitle;
274  mutable string accuracyFile;
275  int theAccuracyTarget;
276 
277  bool theCodeExists;
278  bool theFormOpt;
279  bool theNinja;
280  bool theHiggsEff;
281  bool theMassiveLeptons;
282 
283  int theLoopInducedOption;
284 
285  bool isitDR;
286 
287  mutable bool doneGoSamInit;
288  mutable bool doneGoSamInitRun;
289 
293  vector<int> massiveParticles; //theMassiveParticles;
294 
298  void setupGoSamIn(string setupGoSamInFile);
299 
300 protected:
301 
305  string bindir_;
306 
310  string pkgdatadir_;
311 
315  string GoSamPrefix_;
316 
317 }; // end "class GoSamAmplitude: public MatchboxOLPME"
318 
320  p.persistentOutput(os); return os;
321  }
322 
324  p.persistentInput(is); return is;
325  }
326 
327 } // end "namespace Herwig"
328 
329 #endif /* Herwig_GoSamAmplitude_H */
string GoSamPrefix_
Location of GOSAM.
virtual bool isBDK() const
Return true, if one loop corrections are given in the conventions of BDK.
virtual bool isCS() const
Return true, if one loop corrections are given in the conventions of the integrated dipoles...
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
virtual bool isExpanded() const
Return true, if one loop corrections are given in the conventions of everything expanded.
vector< double > colourCorrelatorResults
Store colour correlator results.
string bindir_
Location of the installed executables.
string pkgdatadir_
Location of the data files.
ostream & operator<<(ostream &, const DecayIntegrator &)
Output information on the DecayIntegrator for debugging purposes.
PersistentIStream & operator>>(PersistentIStream &is, map< ShowerInteraction, T, Cmp, A > &m)
Read a map with ShowerInteraction as the key.
map< int, gosamprocinfo > processmap
Map to store all processes handled by this Amplitude.
vector< double > spinColourCorrelatorResults
Store spin colour correlator results.
virtual bool isDRbar() const
Return true, if the amplitude is DRbar renormalized, otherwise MSbar is assumed.
vector< int > massiveParticles
The PDG codes of those quarks with mass.
-*- C++ -*-
virtual bool hasFinalStateSymmetry() const
Return true, if this amplitude already includes symmetry factors for identical outgoing particles...
MatchboxOLPME implements OLP interfaces.
Definition: MatchboxOLPME.h:27
vector< string > idtypepair
first is the olp id from herwig, second the amplitude type
GoSamAmplitude implements an interface to GoSam.
vector< int > idpair
first is the olp id from herwig, second the answer from gosam
virtual bool isDR() const
Return true, if one loop corrections have been calculated in dimensional reduction.