]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/HepMC/HerwigWrapper.cc
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TEvtGen / HepMC / HerwigWrapper.cc
1 //--------------------------------------------------------------------------
2 //
3 // HerwigWrapper.cc
4 // Author:  Lynn Garren
5 //
6 // ----------------------------------------------------------------------
7
8 #ifdef _WIN32 // Platform: Windows MS Visual C++
9
10 //  Sorry, there is NO version currently available for Vusual C++.
11
12 #else 
13
14 #include <cmath>
15
16 #include "HepMC/HerwigWrapper.h"
17 #include "HepMC/GenCrossSection.h"
18
19 // declare the struct here to keep the shared library happy
20 struct hwgev hwevnt_;
21
22 namespace HepMC {
23
24 GenCrossSection getHerwigCrossSection(int ngen) {
25
26   HepMC::GenCrossSection xsec;
27   // set cross section information and convert to pb (HepMC convention)
28   double xsecval = hwevnt.AVWGT * 1000.0;
29   // statistical error
30   // Herwig has a better calculation of the error, 
31   // but that information does not appear to be saved anywhere
32   double xsecerr = xsecval / std::sqrt((double)ngen);
33   // set and return cross section information
34   xsec.set_cross_section(xsecval, xsecerr);
35   return xsec;
36 }
37
38 } // HepMC
39
40 #endif //Platform