hosted by CEDAR HepForge

LHAPDF the Les Houches Accord PDF Interface


Importing the lhapdf-wrapper into Root

Supplied by Duc Bao Tao - ta 'at' physics.uni-bonn.de (20/11/2007)

After installing, compiling LHAPDF and starting ROOT in the ccwrap path:

[0] .L /path/to/your/lhapdf-5.3.1/ccwrap/.libs/libLHAPDFWrap.so
[1] .L /path/to/your/lhapdf-5.3.1/src/.libs/libLHAPDF.so
[2] .L LHAPDFWrap.h++
Info in : creating shared library /path/to/your/lhapdf-5.3.1/ccwrap/./LHAPDFWrap_h.so

Done! You only have to change the "/path/to/your/lhapdf-5.3.1" according to your installation. 
One can test if everything is fine:

[3] p=LHAPDFWrap()
[4] p.initPDFSet("../PDFsets/MRST2004qed.LHgrid")

Similar this works for pyroot users:

In [1]: from ROOT import *
In [2]: gSystem.Load("/path/to/your/lhapdf-5.3.1/ccwrap/.libs/libLHAPDFWrap.so")
Out[2]: 0
In [3]: gSystem.Load("/path/to/your/lhapdf-5.3.1/src/.libs/libLHAPDF.so")
Out[3]: 0
In [4]: gROOT.LoadMacro("LHAPDFWrap.h++")
Info in : creating shared library /path/to/your/lhapdf-5.3.1/ccwrap/./LHAPDFWrap_h.so
Out[4]: 0

and testing it again:

In [5]: p=LHAPDFWrap()
In [6]: p.initPDFSet("../PDFsets/MRST2004qed.LHgrid")

(Note: the ++ in LHAPDFWrap.h++ tells the CINT interpreter to re-compile the file and re-create 
 the .so library that is loaded into ROOT.)


LHAPDF is maintained by Mike Whalley and Andy Buckley at Durham University (UK)
email: lhapdf@projects.hepforge.org phone: +44-191-334-3807 fax:+44-191-334-3658
Last updated: Wed Nov 21 16:19:29 2007