Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scarrazza/nnpdfdriver
The NNPDF stand-alone driver
https://github.com/scarrazza/nnpdfdriver
Last synced: about 1 month ago
JSON representation
The NNPDF stand-alone driver
- Host: GitHub
- URL: https://github.com/scarrazza/nnpdfdriver
- Owner: scarrazza
- License: gpl-3.0
- Created: 2015-01-09T19:47:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T17:56:06.000Z (almost 9 years ago)
- Last Synced: 2023-04-05T22:47:19.127Z (over 1 year ago)
- Language: C++
- Homepage: http://nnpdf.hepforge.org/
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nnpdfdriver
NNPDF stand-alone drivers for C++ and Fortran77 which
can be easily included in any program. The drivers use as input the
official LHAPDF5 and LHAPDF6 (c++) grids at [lhapdf.hepforge.org/](lhapdf.hepforge.org/).## Download
Checkout the latest release at https://github.com/scarrazza/nnpdfdriver/releases
## Compile
```Shell
cd nnpdfdriver/cpp or nnpdfdriver/fortran
make
```## Run
```Shell
# run example
./testcode
```## Code example
```C++
/**
* NNPDF tutorial: Loading and using a NNPDF grid with the NNPDF Driver.
*
* Compile with:
* g++ -O3 tutorial.cc NNPDFDriver.cc -o prog
*
* Author: The NNPDF Collaboration - 2014
*/
#include "iostream"
#include "cmath"
#include "NNPDFDriver.h"
using namespace std;
int main()
{
NNPDFDriver *nnpdf = new NNPDFDriver("NNPDF23_nlo_as_0119.LHgrid");
nnpdf->initPDF(0); // initialize PDF member
// or use the fast option: grid name + replica number
// NNPDFDriver *nnpdf = new NNPDFDriver("NNPDF23_nlo_as_0119.LHgrid", 0);
double x = 0.1, Q = sqrt(2);
int f = 0;
cout << nnpdf->xfx(x,Q,f) << endl; // prints the gluon x*PDF
delete *nnpdf;
return 0;
}
```A minimilist fortran interface is provided
```C++
void initnnset_(const char* setname); // set the PDF name
void initpdf_(int *mem); // change member
double nnxfx_(double *x, double *Q, int *id); // return x*PDF
```