StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 
25 
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
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 getHerwigCrossSection(int ngen)
calculate the Herwig cross section and statistical error