-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlhapdf6ifcc.cc
59 lines (46 loc) · 1.37 KB
/
lhapdf6ifcc.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// -*- C++ -*-
// LHAPDFv5/v6 compatibility example
#include "LHAPDF/LHAPDF.h"
#include <iostream>
#include <string.h>
using namespace std;
LHAPDF::PDF* *pdfs;
extern "C" {
void setlha6init_(int &maxsets) {
pdfs = new LHAPDF::PDF* [maxsets];
}
void setlha6set_(int &iset, int &ndns, int &order, double &mz, double &asmz,double &q2min) {
pair<string,int> set_mem = LHAPDF::lookupPDF(ndns);
pdfs[iset] = LHAPDF::mkPDF(set_mem.first, set_mem.second);
order = pdfs[iset]->orderQCD();
asmz = pdfs[iset]->alphasQ(mz);
q2min = pdfs[iset]->q2Min();
}
void xfxq2_(int &iset, double &x, double &q2, double fx[13]) {
int j,id;
for(j=0;j<13;j++) {
id = j-6;
if(id==0) id=21;
fx[j] = pdfs[iset]->xfxQ2(id, x, q2);
}
}
bool generic_has_id_(int &iset, int &id) {
return pdfs[iset]->hasFlavor(id);
}
void xf_pdgid_(int &iset, int &id, double &x, double &q2, double &xf) {
xf = pdfs[iset]->xfxQ2(id, x, q2);
}
void setlha6del_(int &iset) {
delete pdfs[iset];
}
void alphasfrompdf0_(int &iset,double &q, double &asq) {
asq = pdfs[iset]->alphasQ(q);
}
void lhapdfname_(int &ndns, char* fstring, int &iset){
string cname=LHAPDF::lookupPDF(ndns).first;
strcpy(fstring,cname.c_str());
iset=LHAPDF::lookupPDF(ndns).second;
//cout<<cname<<"|"<<endl;
//cout<<fstring<<"|"<<endl;
}
}