File indexing completed on 2026-08-06 09:24:12
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef Herwig_GoSamAmplitude_H
0010 #define Herwig_GoSamAmplitude_H
0011
0012
0013
0014
0015 #include "Herwig/MatrixElement/Matchbox/Base/MatchboxOLPME.h"
0016 #include "ThePEG/Utilities/DynamicLoader.h"
0017
0018
0019 namespace Herwig {
0020
0021 using namespace ThePEG;
0022
0023
0024 class gosamprocinfo{
0025
0026 public:
0027 gosamprocinfo(){};
0028 gosamprocinfo(int HID,int GID, string procstr,string typestr):
0029 theHOlpId(HID),theGOlpId(GID),theProcstr(procstr),theTypestr(typestr){
0030 }
0031 ~gosamprocinfo(){}
0032 int HID() const {return theHOlpId;}
0033 int GID() const {return theGOlpId;}
0034 string Pstr() const {return theProcstr;}
0035 string Tstr() const {return theTypestr;}
0036 void setGID(int g){theGOlpId=g;}
0037 void setOAs(int i){ orderAlphas=i;}
0038 int orderAs(){return orderAlphas;}
0039 void setOAew(int j){ orderAlphaew=j;}
0040 int orderAew(){return orderAlphaew;}
0041 private:
0042 int theHOlpId;
0043 int theGOlpId;
0044 string theProcstr;
0045 string theTypestr;
0046 int orderAlphas;
0047 int orderAlphaew;
0048 public:
0049 void persistentOutput(PersistentOStream & os) const{os<<theHOlpId<<theGOlpId<<theProcstr<<theTypestr<<orderAlphas<<orderAlphaew;}
0050 void persistentInput(PersistentIStream &is) {is>>theHOlpId>>theGOlpId>>theProcstr>>theTypestr>>orderAlphas>>orderAlphaew;}
0051 };
0052
0053
0054
0055
0056
0057
0058
0059
0060 class GoSamAmplitude: public MatchboxOLPME {
0061
0062 public:
0063
0064
0065
0066
0067 GoSamAmplitude();
0068
0069 public:
0070
0071 virtual void fillOrderFile(const map<pair<Process,int>,int>& procs, string OrderFileName);
0072
0073 virtual bool isCS() const { return false; }
0074 virtual bool isExpanded() const { return true; }
0075 virtual bool isBDK() const { return false; }
0076 virtual bool isDR() const { return isitDR; }
0077 virtual bool isDRbar() const {return false;}
0078
0079
0080
0081
0082
0083 virtual void signOLP(const string&, const string&);
0084
0085 virtual bool checkOLPContract(string contractFileName);
0086
0087
0088
0089
0090
0091
0092 virtual bool hasFinalStateSymmetry() const { return false; }
0093
0094 virtual bool buildGoSam();
0095
0096
0097
0098
0099 virtual void startOLP(const string&, int& status);
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112 virtual bool startOLP(const map<pair<Process,int>,int>& procs);
0113
0114
0115
0116
0117 void evalSubProcess() const;
0118
0119
0120
0121
0122 virtual void evalColourCorrelator(pair<int,int> ij) const;
0123
0124
0125
0126
0127
0128
0129 virtual LorentzVector<Complex> plusPolarization(const Lorentz5Momentum& p,
0130 const Lorentz5Momentum& n, int inc) const;
0131
0132
0133
0134
0135 virtual void evalSpinColourCorrelator(pair<int,int> ij) const;
0136
0137 void getids() const;
0138
0139 int accuracyTargetNegExp() const { return theAccuracyTarget; }
0140
0141 public:
0142
0143
0144
0145
0146
0147
0148
0149
0150 void persistentOutput(PersistentOStream & os) const;
0151
0152
0153
0154
0155
0156
0157 void persistentInput(PersistentIStream & is, int version);
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167 static void Init();
0168
0169
0170 protected:
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180 virtual void doinit();
0181
0182
0183
0184
0185
0186 virtual void doinitrun();
0187
0188
0189
0190 protected:
0191
0192
0193
0194
0195
0196
0197
0198
0199 virtual IBPtr clone() const;
0200
0201
0202
0203
0204
0205 virtual IBPtr fullclone() const;
0206
0207
0208
0209
0210
0211
0212
0213
0214 private:
0215
0216
0217
0218
0219
0220 GoSamAmplitude & operator=(const GoSamAmplitude &) = delete;
0221
0222
0223
0224
0225 mutable vector<double> colourCorrelatorResults;
0226
0227
0228
0229
0230 mutable vector<double> spinColourCorrelatorResults;
0231
0232
0233
0234
0235 mutable vector<int> idpair;
0236
0237
0238
0239
0240 mutable vector<string> idtypepair;
0241
0242
0243
0244
0245 map<int , gosamprocinfo > processmap;
0246
0247 mutable string gosamPathInterface;
0248 mutable string gosamSetupInFileNameInterface;
0249 mutable string gosamBuildScript;
0250
0251 mutable string gosamPath;
0252 mutable string gosamSourcePath;
0253 mutable string gosamInstallPath;
0254
0255 mutable string gosamSetupInFileName;
0256
0257 mutable string orderFileTitle;
0258 mutable string contractFileTitle;
0259 mutable string contractFileName;
0260 mutable string orderFileName;
0261
0262 mutable string accuracyFileTitle;
0263 mutable string accuracyFile;
0264 int theAccuracyTarget;
0265
0266 bool theCodeExists;
0267 bool theFormOpt;
0268 bool theNinja;
0269 bool theHiggsEff;
0270 bool theMassiveLeptons;
0271
0272 int theLoopInducedOption;
0273
0274 bool isitDR;
0275
0276 mutable bool doneGoSamInit;
0277 mutable bool doneGoSamInitRun;
0278
0279
0280
0281
0282 vector<int> massiveParticles;
0283
0284
0285
0286
0287 void setupGoSamIn(string setupGoSamInFile);
0288
0289 protected:
0290
0291
0292
0293
0294 string bindir_;
0295
0296
0297
0298
0299 string pkgdatadir_;
0300
0301
0302
0303
0304 string GoSamPrefix_;
0305
0306 };
0307
0308 inline PersistentOStream& operator<<(PersistentOStream& os, const gosamprocinfo& p) {
0309 p.persistentOutput(os); return os;
0310 }
0311
0312 inline PersistentIStream& operator>>(PersistentIStream& is, gosamprocinfo& p) {
0313 p.persistentInput(is); return is;
0314 }
0315
0316 }
0317
0318 #endif