StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
LHAPDFInterface.h
1 // LHAPDFInterface.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2012 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.
5 
6 // Header file for the LHAPDF f77 external linkage to C++.
7 // All required code is contained here, i.e. there is no matching .cc file.
8 
9 #ifndef Pythia8_LHAPDFInterface_H
10 #define Pythia8_LHAPDFInterface_H
11 
12 namespace Pythia8 {
13 
14 //==========================================================================
15 
16 // Declare the LHAPDF f77 subroutines that are needed.
17 
18 extern "C" {
19 
20  extern void initpdfsetm_(int&, const char*, int);
21 
22  extern void initpdfsetbynamem_(int&, const char*, int);
23 
24  extern void initpdfm_(int&, int&);
25 
26  extern void evolvepdfm_(int&, double&, double&, double*);
27 
28  extern void evolvepdfphotonm_(int&, double&, double&, double*, double&);
29 
30  extern void setlhaparm_(const char*, int);
31 
32 }
33 
34 //==========================================================================
35 
36 // Interfaces to the above routines, to make the C++ calls similar to f77.
37 
39 
40 public:
41 
42  // Initialize set with full pathname, allowing multiple sets.
43  static void initPDFsetM( int& nSet, string name) {
44  const char* cName = name.c_str(); int lenName = name.length();
45  initpdfsetm_( nSet, cName, lenName);
46  }
47 
48  // Initialize set with simple name, allowing multiple sets.
49  static void initPDFsetByNameM( int& nSet, string name) {
50  const char* cName = name.c_str(); int lenName = name.length();
51  initpdfsetbynamem_( nSet, cName, lenName);
52  }
53 
54  // Initialize member of set.
55  static void initPDFM(int& nSet, int member) {
56  initpdfm_(nSet, member);
57  }
58 
59  // Evaluate x f_i(x, Q).
60  static void evolvePDFM( int& nSet, double x, double Q, double* xfArray) {
61  evolvepdfm_( nSet, x, Q, xfArray);
62  }
63 
64  // Evaluate x f_i(x, Q) including photon
65  static void evolvePDFPHOTONM( int& nSet, double x, double Q,
66  double* xfArray, double& xPhoton) {
67  evolvepdfphotonm_( nSet, x, Q, xfArray, xPhoton);
68  }
69 
70  // Extrapolate PDF set beyond boundaries, or freeze them there.
71  static void setPDFparm(string name) {
72  const char* cName = name.c_str(); int lenName = name.length();
73  setlhaparm_( cName, lenName);
74  }
75 
76 
77 };
78 
79 //==========================================================================
80 
81 } // end namespace Pythia8
82 
83 #endif // Pythia8_LHAPDFInterface_H