Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:10

0001 //--------------------------------------------------------------------------
0002 #ifndef PYTHIA_WRAPPER_H
0003 #define PYTHIA_WRAPPER_H
0004 
0005 //////////////////////////////////////////////////////////////////////////
0006 // Matt.Dobbs@Cern.CH, November 2000
0007 // Just a link to whichever pythia version is current.
0008 //////////////////////////////////////////////////////////////////////////
0009 
0010 // This pre-compiler directive is included (2002-01-16) to allow compatibility
0011 // with MS Visual C++, which interfaces to fortran in a different manner.
0012 // For it to work you need to define the _WIN32 variable when compiling.
0013 #ifdef _WIN32 // Platform: Windows MS Visual C++
0014 #include "HepMC/PythiaWrapper6_4_WIN32.h"
0015 
0016 #else // Generic version, tested on Linux ecgs/gcc
0017 #include "HepMC/PythiaWrapper6_4.h"
0018 
0019 #endif // Platform
0020 
0021 #include <cmath>
0022 
0023 #include "HepMC/GenCrossSection.h"
0024 
0025 namespace HepMC {
0026 
0027 /// calculate the Pythia cross section and statistical error
0028 inline GenCrossSection getPythiaCrossSection() {
0029 
0030   GenCrossSection xsec;
0031   // xsec(0,2) contains the sum of differential cross sections in mb
0032   // ngen(0,2) contains the combined number of generated events
0033   // convert to pb (HepMC convention)
0034   double xsecval = pyint5.xsec[2][0] * 1.0e9;
0035   // statistical error
0036   double xsecerr = xsecval / std::sqrt( (double)pyint5.ngen[2][0] );
0037   // set and return cross section information
0038   xsec.set_cross_section(xsecval, xsecerr);
0039   return xsec;
0040 }
0041 
0042 
0043 
0044 } // HepMC
0045 
0046 #endif  // PYTHIA_WRAPPER_H
0047 //--------------------------------------------------------------------------