File indexing completed on 2025-10-31 09:11:07
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 #ifndef Pythia8_LHAFortran_H
0012 #define Pythia8_LHAFortran_H
0013 
0014 #include "Pythia8/Pythia.h"
0015 
0016 namespace Pythia8 {
0017 
0018 
0019 
0020 
0021 
0022 #ifdef _WIN32
0023   #define heprup_ HEPRUP
0024   #define hepeup_ HEPEUP
0025 #endif
0026 
0027 extern "C" {
0028 
0029   extern struct {
0030     int idbmup[2];
0031     double ebmup[2];
0032     int pdfgup[2], pdfsup[2], idwtup, nprup;
0033     double xsecup[100], xerrup[100], xmaxup[100];
0034     int lprup[100];
0035   } heprup_;
0036 
0037   extern struct {
0038     int nup, idprup;
0039     double xwgtup, scalup, aqedup, aqcdup;
0040     int idup[500], istup[500], mothup[500][2], icolup[500][2];
0041     double pup[500][5], vtimup[500],spinup[500];
0042   } hepeup_;
0043 
0044 }
0045 
0046 
0047 
0048 
0049 
0050 
0051 class LHAupFortran : public LHAup {
0052 
0053 public:
0054 
0055   
0056   LHAupFortran() {}
0057 
0058   
0059   bool setInit() {
0060     
0061     if (!fillHepRup()) return false;
0062     
0063     setBeamA(heprup_.idbmup[0], heprup_.ebmup[0], heprup_.pdfgup[0],
0064       heprup_.pdfsup[0]);
0065     setBeamB(heprup_.idbmup[1], heprup_.ebmup[1], heprup_.pdfgup[1],
0066       heprup_.pdfsup[1]);
0067     setStrategy(heprup_.idwtup);
0068     
0069     for (int ip = 0; ip < heprup_.nprup; ++ip) {
0070       double xsec = max( 1e-10, heprup_.xsecup[ip]);
0071       addProcess( heprup_.lprup[ip], xsec, heprup_.xerrup[ip],
0072         heprup_.xmaxup[ip] );
0073     }
0074     
0075     eBeamA = heprup_.ebmup[0];
0076     eBeamB = heprup_.ebmup[1];
0077     
0078     return true;
0079   }
0080 
0081   
0082   bool setEvent(int idProcIn = 0) {
0083     
0084     hepeup_.idprup = idProcIn;
0085     
0086     if (!fillHepEup()) return false;
0087     
0088     setProcess(hepeup_.idprup, hepeup_.xwgtup, hepeup_.scalup,
0089       hepeup_.aqedup, hepeup_.aqcdup);
0090     
0091     for (int ip = 0; ip < hepeup_.nup; ++ip) addParticle(hepeup_.idup[ip],
0092       hepeup_.istup[ip], hepeup_.mothup[ip][0], hepeup_.mothup[ip][1],
0093       hepeup_.icolup[ip][0], hepeup_.icolup[ip][1], hepeup_.pup[ip][0],
0094       hepeup_.pup[ip][1], hepeup_.pup[ip][2], hepeup_.pup[ip][3],
0095       hepeup_.pup[ip][4], hepeup_.vtimup[ip], hepeup_.spinup[ip]) ;
0096     
0097     setPdf( hepeup_.idup[0], hepeup_.idup[1], hepeup_.pup[0][3]/eBeamA,
0098       hepeup_.pup[1][3]/eBeamB, 0., 0., 0., false);
0099     
0100     return true;
0101   }
0102 
0103 protected:
0104 
0105   
0106   virtual bool fillHepRup() {return false;}
0107 
0108   
0109   virtual bool fillHepEup() {return false;}
0110 
0111 private:
0112 
0113   
0114   double eBeamA, eBeamB;
0115 
0116 };
0117 
0118 
0119 
0120 } 
0121 
0122 #endif