1 // LHAFortran.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2010 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
6 // Header file for Fortran Les Houches Accord user process information.
7 // LHAupFortran: derived class with the HEPRUP and HEPEUP Fortran info.
8 // You are expected to supply the fillHepRup and fillHepEup methods.
10 #ifndef Pythia8_LHAFortran_H
11 #define Pythia8_LHAFortran_H
13 #include "PythiaStdlib.h"
17 //==========================================================================
19 // Give access to the HEPRUP and HEPEUP Fortran commonblocks.
22 #define heprup_ HEPRUP
23 #define hepeup_ HEPEUP
31 int pdfgup[2], pdfsup[2], idwtup, nprup;
32 double xsecup[100], xerrup[100], xmaxup[100];
38 double xwgtup, scalup, aqedup, aqcdup;
39 int idup[500], istup[500], mothup[500][2], icolup[500][2];
40 double pup[500][5], vtimup[500],spinup[500];
45 //==========================================================================
47 // A derived class with initialization information from the HEPRUP
48 // Fortran commonblock and event information from the HEPEUP one.
50 class LHAupFortran : public LHAup {
57 // Routine for doing the job of setting initialization info.
59 // Call the routine that does the job.
60 if (!fillHepRup()) return false;
61 // Store beam and strategy info.
62 setBeamA(heprup_.idbmup[0], heprup_.ebmup[0], heprup_.pdfgup[0],
64 setBeamB(heprup_.idbmup[1], heprup_.ebmup[1], heprup_.pdfgup[1],
66 setStrategy(heprup_.idwtup);
67 // Store process info. Protect against vanishing cross section.
68 for (int ip = 0; ip < heprup_.nprup; ++ip) {
69 double xsec = max( 1e-10, heprup_.xsecup[ip]);
70 addProcess( heprup_.lprup[ip], xsec, heprup_.xerrup[ip],
73 // Store the beam energies to calculate x values later.
74 eBeamA = heprup_.ebmup[0];
75 eBeamB = heprup_.ebmup[1];
80 // Routine for doing the job of setting info on next event.
81 bool setEvent(int idProcIn = 0) {
82 // In some strategies the type of the next event has been set.
83 hepeup_.idprup = idProcIn;
84 // Call the routine that does the job.
85 if (!fillHepEup()) return false;
86 // Store process info.
87 setProcess(hepeup_.idprup, hepeup_.xwgtup, hepeup_.scalup,
88 hepeup_.aqedup, hepeup_.aqcdup);
89 // Store particle info.
90 for (int ip = 0; ip < hepeup_.nup; ++ip) addParticle(hepeup_.idup[ip],
91 hepeup_.istup[ip], hepeup_.mothup[ip][0], hepeup_.mothup[ip][1],
92 hepeup_.icolup[ip][0], hepeup_.icolup[ip][1], hepeup_.pup[ip][0],
93 hepeup_.pup[ip][1], hepeup_.pup[ip][2], hepeup_.pup[ip][3],
94 hepeup_.pup[ip][4], hepeup_.vtimup[ip], hepeup_.spinup[ip]) ;
95 // Store x values (here E = pup[ip][3]), but note incomplete info.
96 setPdf( hepeup_.idup[0], hepeup_.idup[1], hepeup_.pup[0][3]/eBeamA,
97 hepeup_.pup[1][3]/eBeamB, 0., 0., 0., false);
104 // Save beam energies to calculate x values.
105 double eBeamA, eBeamB;
107 // User-written routine that does the intialization and fills heprup.
110 // User-written routine that does the event generation and fills hepeup.
115 //==========================================================================
117 } // end namespace Pythia8
119 #endif // Pythia8_LHAFortran_H