StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PythiaWrapper.h
1 //--------------------------------------------------------------------------
2 #ifndef PYTHIA_WRAPPER_H
3 #define PYTHIA_WRAPPER_H
4 
6 // Matt.Dobbs@Cern.CH, November 2000
7 // Just a link to whichever pythia version is current.
9 
10 // This pre-compiler directive is included (2002-01-16) to allow compatibility
11 // with MS Visual C++, which interfaces to fortran in a different manner.
12 // For it to work you need to define the _WIN32 variable when compiling.
13 #ifdef _WIN32 // Platform: Windows MS Visual C++
14 #include "HepMC/PythiaWrapper6_4_WIN32.h"
15 
16 #else // Generic version, tested on Linux ecgs/gcc
17 #include "HepMC/PythiaWrapper6_4.h"
18 
19 #endif // Platform
20 
21 #include <cmath>
22 
23 #include "HepMC/GenCrossSection.h"
24 
25 namespace HepMC {
26 
29 
30  GenCrossSection xsec;
31  // xsec(0,2) contains the sum of differential cross sections in mb
32  // ngen(0,2) contains the combined number of generated events
33  // convert to pb (HepMC convention)
34  double xsecval = pyint5.xsec[2][0] * 1.0e9;
35  // statistical error
36  double xsecerr = xsecval / std::sqrt( (double)pyint5.ngen[2][0] );
37  // set and return cross section information
38  xsec.set_cross_section(xsecval, xsecerr);
39  return xsec;
40 }
41 
42 
43 
44 } // HepMC
45 
46 #endif // PYTHIA_WRAPPER_H
47 //--------------------------------------------------------------------------
void set_cross_section(double xs, double xs_err)
Set cross section and error in pb.
The GenCrossSection class stores the generated cross section.
GenCrossSection getPythiaCrossSection()
calculate the Pythia cross section and statistical error
Definition: PythiaWrapper.h:28